MCPcopy
hub / github.com/urllib3/urllib3 / test_rewind_body

Method test_rewind_body

test/test_util.py:587–596  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

585 assert make_headers(**kwargs) == expected # type: ignore[arg-type]
586
587 def test_rewind_body(self) -> None:
588 body = io.BytesIO(b"test data")
589 assert body.read() == b"test data"
590
591 # Assert the file object has been consumed
592 assert body.read() == b""
593
594 # Rewind it back to just be b'data'
595 rewind_body(body, 5)
596 assert body.read() == b"data"
597
598 def test_rewind_body_failed_tell(self) -> None:
599 body = io.BytesIO(b"test data")

Callers

nothing calls this directly

Calls 2

rewind_bodyFunction · 0.90
readMethod · 0.45

Tested by

no test coverage detected