MCPcopy
hub / github.com/urllib3/urllib3 / test_multi_decoding_gzip_gzip

Method test_multi_decoding_gzip_gzip

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

Source from the content-addressed store, hash-verified

920 assert r.data == b"foo"
921
922 def test_multi_decoding_gzip_gzip(self) -> None:
923 compress = zlib.compressobj(6, zlib.DEFLATED, 16 + zlib.MAX_WBITS)
924 data = compress.compress(b"foo")
925 data += compress.flush()
926
927 compress = zlib.compressobj(6, zlib.DEFLATED, 16 + zlib.MAX_WBITS)
928 data = compress.compress(data)
929 data += compress.flush()
930
931 fp = BytesIO(data)
932 r = HTTPResponse(fp, headers={"content-encoding": "gzip, gzip"})
933
934 assert r.data == b"foo"
935
936 def test_read_multi_decoding_deflate_deflate(self) -> None:
937 msg = b"foobarbaz" * 42

Callers

nothing calls this directly

Calls 2

HTTPResponseClass · 0.90
flushMethod · 0.45

Tested by

no test coverage detected