MCPcopy
hub / github.com/encode/httpx / test_line_decoder_crnl

Function test_line_decoder_crnl

tests/test_decoders.py:331–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329
330
331def test_line_decoder_crnl():
332 response = httpx.Response(200, content=[b"", b"a\r\n\r\nb\r\nc"])
333 assert list(response.iter_lines()) == ["a", "", "b", "c"]
334
335 response = httpx.Response(200, content=[b"", b"a\r\n\r\nb\r\nc\r\n"])
336 assert list(response.iter_lines()) == ["a", "", "b", "c"]
337
338 response = httpx.Response(200, content=[b"", b"a\r", b"\n\r\nb\r\nc"])
339 assert list(response.iter_lines()) == ["a", "", "b", "c"]
340
341 # Issue #1033
342 response = httpx.Response(200, content=[b"", b"12345\r\n", b"foo bar baz\r\n"])
343 assert list(response.iter_lines()) == ["12345", "foo bar baz"]
344
345
346def test_invalid_content_encoding_header():

Callers

nothing calls this directly

Calls 1

iter_linesMethod · 0.95

Tested by

no test coverage detected