Skip to content

Commit

Permalink
Added test of LineDecoder.decode edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Dec 11, 2023
1 parent 576d69c commit e19a418
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ def test_line_decoder_crnl():
assert list(response.iter_lines()) == ["12345", "foo bar baz"]


@pytest.mark.parametrize(["text", "expected"], [("", [])])
def test_line_decoding_edge_cases(text: str, expected: typing.List[str]) -> None:
assert httpx._decoders.LineDecoder().decode(text) == expected


def test_invalid_content_encoding_header():
headers = [(b"Content-Encoding", b"invalid-header")]
body = b"test 123"
Expand Down

0 comments on commit e19a418

Please sign in to comment.