MCPcopy
hub / github.com/urllib3/urllib3 / test_reference_read

Method test_reference_read

test/test_response.py:303–311  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

301 HTTPResponse(fp, headers={"content-encoding": "deflate"})
302
303 def test_reference_read(self) -> None:
304 fp = BytesIO(b"foo")
305 r = HTTPResponse(fp, preload_content=False)
306
307 assert r.read(0) == b""
308 assert r.read(1) == b"f"
309 assert r.read(2) == b"oo"
310 assert r.read() == b""
311 assert r.read() == b""
312
313 @pytest.mark.parametrize("read_args", ((), (None,), (-1,)))
314 def test_reference_read_until_eof(self, read_args: tuple[typing.Any, ...]) -> None:

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
HTTPResponseClass · 0.90

Tested by

no test coverage detected