MCPcopy
hub / github.com/urllib3/urllib3 / test_chunked_decoding_deflate

Method test_chunked_decoding_deflate

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

Source from the content-addressed store, hash-verified

374 assert r.data == b"foo"
375
376 def test_chunked_decoding_deflate(self) -> None:
377 data = zlib.compress(b"foo")
378
379 fp = BytesIO(data)
380 r = HTTPResponse(
381 fp, headers={"content-encoding": "deflate"}, preload_content=False
382 )
383
384 assert r.read(1) == b"f"
385 assert r.read(2) == b"oo"
386 assert r.read() == b""
387 assert r.read() == b""
388
389 def test_chunked_decoding_deflate2(self) -> None:
390 compress = zlib.compressobj(6, zlib.DEFLATED, -zlib.MAX_WBITS)

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
HTTPResponseClass · 0.90

Tested by

no test coverage detected