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

Function test_multi

tests/test_decoders.py:144–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142
143
144def test_multi():
145 body = b"test 123"
146
147 deflate_compressor = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS)
148 compressed_body = deflate_compressor.compress(body) + deflate_compressor.flush()
149
150 gzip_compressor = zlib.compressobj(9, zlib.DEFLATED, zlib.MAX_WBITS | 16)
151 compressed_body = (
152 gzip_compressor.compress(compressed_body) + gzip_compressor.flush()
153 )
154
155 headers = [(b"Content-Encoding", b"deflate, gzip")]
156 response = httpx.Response(
157 200,
158 headers=headers,
159 content=compressed_body,
160 )
161 assert response.content == body
162
163
164def test_multi_with_identity():

Callers

nothing calls this directly

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected