MCPcopy
hub / github.com/encode/httpx / test_gzip

Function test_gzip

tests/test_decoders.py:51–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51def test_gzip():
52 body = b"test 123"
53 compressor = zlib.compressobj(9, zlib.DEFLATED, zlib.MAX_WBITS | 16)
54 compressed_body = compressor.compress(body) + compressor.flush()
55
56 headers = [(b"Content-Encoding", b"gzip")]
57 response = httpx.Response(
58 200,
59 headers=headers,
60 content=compressed_body,
61 )
62 assert response.content == body
63
64
65def test_brotli():

Callers

nothing calls this directly

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected