(self)
| 1774 | assert orig_ex.expected == content_length |
| 1775 | |
| 1776 | def test_incomplete_chunk(self) -> None: |
| 1777 | stream = [b"foooo", b"bbbbaaaaar"] |
| 1778 | fp = MockChunkedIncompleteRead(stream) |
| 1779 | r = httplib.HTTPResponse(MockSock) # type: ignore[arg-type] |
| 1780 | r.fp = fp # type: ignore[assignment] |
| 1781 | r.chunked = True |
| 1782 | r.chunk_left = None |
| 1783 | resp = HTTPResponse( |
| 1784 | r, preload_content=False, headers={"transfer-encoding": "chunked"} |
| 1785 | ) |
| 1786 | with pytest.raises(ProtocolError) as ctx: |
| 1787 | next(resp.read_chunked()) |
| 1788 | |
| 1789 | orig_ex = ctx.value.args[1] |
| 1790 | assert isinstance(orig_ex, httplib_IncompleteRead) |
| 1791 | |
| 1792 | def test_invalid_chunk_length(self) -> None: |
| 1793 | stream = [b"foooo", b"bbbbaaaaar"] |
nothing calls this directly
no test coverage detected