MCPcopy
hub / github.com/urllib3/urllib3 / test_decode_gzip_multi_member

Method test_decode_gzip_multi_member

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

Source from the content-addressed store, hash-verified

418 assert r.read() == b""
419
420 def test_decode_gzip_multi_member(self) -> None:
421 compress = zlib.compressobj(6, zlib.DEFLATED, 16 + zlib.MAX_WBITS)
422 data = compress.compress(b"foo")
423 data += compress.flush()
424 data = data * 3
425
426 fp = BytesIO(data)
427 r = HTTPResponse(fp, headers={"content-encoding": "gzip"})
428
429 assert r.data == b"foofoofoo"
430
431 def test_decode_gzip_error(self) -> None:
432 fp = BytesIO(b"foo")

Callers

nothing calls this directly

Calls 2

HTTPResponseClass · 0.90
flushMethod · 0.45

Tested by

no test coverage detected