MCPcopy
hub / github.com/urllib3/urllib3 / test_reference_read1

Method test_reference_read1

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

Source from the content-addressed store, hash-verified

317 assert r.read(*read_args) == b"foo"
318
319 def test_reference_read1(self) -> None:
320 fp = BytesIO(b"foobar")
321 r = HTTPResponse(fp, preload_content=False)
322
323 assert r.read1(0) == b""
324 assert r.read1(1) == b"f"
325 assert r.read1(2) == b"oo"
326 assert r.read1() == b"bar"
327 assert r.read1() == b""
328
329 @pytest.mark.parametrize("read1_args", ((), (None,), (-1,)))
330 def test_reference_read1_without_limit(

Callers

nothing calls this directly

Calls 2

read1Method · 0.95
HTTPResponseClass · 0.90

Tested by

no test coverage detected