MCPcopy
hub / github.com/urllib3/urllib3 / test_decoding_read1

Method test_decoding_read1

test/test_response.py:347–358  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

345 assert r.read1() == b""
346
347 def test_decoding_read1(self) -> None:
348 data = zlib.compress(b"foobar")
349
350 fp = BytesIO(data)
351 r = HTTPResponse(
352 fp, headers={"content-encoding": "deflate"}, preload_content=False
353 )
354
355 assert r.read1(1) == b"f"
356 assert r.read1(2) == b"oo"
357 assert r.read1() == b"bar"
358 assert r.read1() == b""
359
360 def test_decode_deflate(self) -> None:
361 data = zlib.compress(b"foo")

Callers

nothing calls this directly

Calls 2

read1Method · 0.95
HTTPResponseClass · 0.90

Tested by

no test coverage detected