(self, content_encoding: str)
| 403 | |
| 404 | @pytest.mark.parametrize("content_encoding", ["gzip", "x-gzip"]) |
| 405 | def test_chunked_decoding_gzip(self, content_encoding: str) -> None: |
| 406 | compress = zlib.compressobj(6, zlib.DEFLATED, 16 + zlib.MAX_WBITS) |
| 407 | data = compress.compress(b"foo") |
| 408 | data += compress.flush() |
| 409 | |
| 410 | fp = BytesIO(data) |
| 411 | r = HTTPResponse( |
| 412 | fp, headers={"content-encoding": content_encoding}, preload_content=False |
| 413 | ) |
| 414 | |
| 415 | assert r.read(1) == b"f" |
| 416 | assert r.read(2) == b"oo" |
| 417 | assert r.read() == b"" |
| 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) |
nothing calls this directly
no test coverage detected