(self)
| 387 | assert r.read() == b"" |
| 388 | |
| 389 | def test_chunked_decoding_deflate2(self) -> None: |
| 390 | compress = zlib.compressobj(6, zlib.DEFLATED, -zlib.MAX_WBITS) |
| 391 | data = compress.compress(b"foo") |
| 392 | data += compress.flush() |
| 393 | |
| 394 | fp = BytesIO(data) |
| 395 | r = HTTPResponse( |
| 396 | fp, headers={"content-encoding": "deflate"}, preload_content=False |
| 397 | ) |
| 398 | |
| 399 | assert r.read(1) == b"f" |
| 400 | assert r.read(2) == b"oo" |
| 401 | assert r.read() == b"" |
| 402 | assert r.read() == b"" |
| 403 | |
| 404 | @pytest.mark.parametrize("content_encoding", ["gzip", "x-gzip"]) |
| 405 | def test_chunked_decoding_gzip(self, content_encoding: str) -> None: |
nothing calls this directly
no test coverage detected