]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Remove some private imports from test_decoders (#2496)
authorTom Christie <tom@tomchristie.com>
Tue, 6 Dec 2022 18:22:04 +0000 (18:22 +0000)
committerGitHub <noreply@github.com>
Tue, 6 Dec 2022 18:22:04 +0000 (18:22 +0000)
tests/test_decoders.py

index a7e3f369c9b9356ac5f665241f11b2c96b3adb0e..359c1c4b19626fdf99d46c143e2929178b4354cd 100644 (file)
@@ -6,16 +6,7 @@ import pytest
 
 import httpx
 from httpx._compat import brotli
-from httpx._decoders import (
-    BrotliDecoder,
-    ByteChunker,
-    DeflateDecoder,
-    GZipDecoder,
-    IdentityDecoder,
-    LineDecoder,
-    TextChunker,
-    TextDecoder,
-)
+from httpx._decoders import ByteChunker, LineDecoder, TextChunker, TextDecoder
 
 
 def test_deflate():
@@ -153,14 +144,11 @@ def test_empty_content(header_value):
     assert response.content == b""
 
 
-@pytest.mark.parametrize(
-    "decoder", (BrotliDecoder, DeflateDecoder, GZipDecoder, IdentityDecoder)
-)
-def test_decoders_empty_cases(decoder):
-    response = httpx.Response(content=b"", status_code=200)
-    instance = decoder()
-    assert instance.decode(response.content) == b""
-    assert instance.flush() == b""
+@pytest.mark.parametrize("header_value", (b"deflate", b"gzip", b"br", b"identity"))
+def test_decoders_empty_cases(header_value):
+    headers = [(b"Content-Encoding", header_value)]
+    response = httpx.Response(content=b"", status_code=200, headers=headers)
+    assert response.read() == b""
 
 
 @pytest.mark.parametrize("header_value", (b"deflate", b"gzip", b"br"))