MCPcopy
hub / github.com/urllib3/urllib3 / test_chunked_decoding_brotli

Method test_chunked_decoding_brotli

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

Source from the content-addressed store, hash-verified

475
476 @onlyBrotli()
477 def test_chunked_decoding_brotli(self) -> None:
478 data = brotli.compress(b"foobarbaz")
479
480 fp = BytesIO(data)
481 r = HTTPResponse(fp, headers={"content-encoding": "br"}, preload_content=False)
482
483 ret = b""
484 for _ in range(100):
485 ret += r.read(1)
486 if r.closed:
487 break
488 assert ret == b"foobarbaz"
489
490 @onlyBrotli()
491 def test_decode_brotli_error(self) -> None:

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
HTTPResponseClass · 0.90

Tested by

no test coverage detected