(self, data: bytes)
| 645 | @onlyZstd() |
| 646 | @pytest.mark.parametrize("data", decode_param_set) |
| 647 | def test_decode_zstd_incomplete_read1(self, data: bytes) -> None: |
| 648 | data = zstd_compress(data) |
| 649 | fp = BytesIO(data[:-1]) |
| 650 | |
| 651 | r = HTTPResponse( |
| 652 | fp, headers={"content-encoding": "zstd"}, preload_content=False |
| 653 | ) |
| 654 | |
| 655 | # read/decode via read1(!), expecting DecodeError |
| 656 | with pytest.raises(DecodeError): |
| 657 | amt_decoded = 0 |
| 658 | # loop, as read1() may return just partial data |
| 659 | while amt_decoded < len(data): |
| 660 | part = r.read1(decode_content=True) |
| 661 | amt_decoded += len(part) |
| 662 | |
| 663 | @onlyZstd() |
| 664 | @pytest.mark.parametrize("data", decode_param_set) |
nothing calls this directly
no test coverage detected