Skip to content
Myr

Drop unneccessary private import in tests (#2498)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by GitHub · parent a8dd079 · Browse files · 1 file+5 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−8 removed

  • tests:+5 added−8 removed

1 file+5 added−8 removed

modified:tests/models/test_responses.py+5 added-8 removed
4 unmodified lines
5import chardet6import pytest78import httpx9from httpx._compat import brotli91011class StreamingBody:12 def __iter__(self):
848 unmodified lines
861862@pytest.mark.parametrize("header_value", (b"deflate", b"gzip", b"br"))863def test_decode_error_with_request(header_value):864 headers = [(b"Content-Encoding", header_value)]866 body = b"test 123"867 compressed_body = brotli.compress(body)[3:]865 broken_compressed_body = b"xxxxxxxxxxxxxx"866 with pytest.raises(httpx.DecodingError):867 httpx.Response(868 200,869 headers=headers,872 content=compressed_body,870 content=broken_compressed_body,871 )872873 with pytest.raises(httpx.DecodingError):874 httpx.Response(875 200,876 headers=headers,879 content=compressed_body,877 content=broken_compressed_body,878 request=httpx.Request("GET", "https://www.example.org/"),879 )880881882@pytest.mark.parametrize("header_value", (b"deflate", b"gzip", b"br"))883def test_value_error_without_request(header_value):884 headers = [(b"Content-Encoding", header_value)]887 body = b"test 123"888 compressed_body = brotli.compress(body)[3:]885 broken_compressed_body = b"xxxxxxxxxxxxxx"886 with pytest.raises(httpx.DecodingError):890 httpx.Response(200, headers=headers, content=compressed_body)887 httpx.Response(200, headers=headers, content=broken_compressed_body)888889890def test_response_with_unset_request():891 response = httpx.Response(200, content=b"Hello, world!")
120 unmodified lines