Skip to content

Commit

Permalink
Remove some private imports from test_decoders (#2496)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie authored Dec 6, 2022
1 parent 71a1589 commit 563a103
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions tests/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 563a103

Please sign in to comment.