From 563a1031f5bd37445d2fdbf622ba5cab926207c9 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 6 Dec 2022 18:22:04 +0000 Subject: [PATCH] Remove some private imports from test_decoders (#2496) --- tests/test_decoders.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/test_decoders.py b/tests/test_decoders.py index a7e3f369c9..359c1c4b19 100644 --- a/tests/test_decoders.py +++ b/tests/test_decoders.py @@ -6,16 +6,7 @@ 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"))