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

Function test_line_decoder_nl

tests/test_decoders.py:303–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301
302
303def test_line_decoder_nl():
304 response = httpx.Response(200, content=[b""])
305 assert list(response.iter_lines()) == []
306
307 response = httpx.Response(200, content=[b"", b"a\n\nb\nc"])
308 assert list(response.iter_lines()) == ["a", "", "b", "c"]
309
310 # Issue #1033
311 response = httpx.Response(
312 200, content=[b"", b"12345\n", b"foo ", b"bar ", b"baz\n"]
313 )
314 assert list(response.iter_lines()) == ["12345", "foo bar baz"]
315
316
317def test_line_decoder_cr():

Callers

nothing calls this directly

Calls 1

iter_linesMethod · 0.95

Tested by

no test coverage detected