| 142 | |
| 143 | |
| 144 | def 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 | |
| 164 | def test_multi_with_identity(): |