MCPcopy
hub / github.com/urllib3/urllib3 / test_rewind_body_failed_tell

Method test_rewind_body_failed_tell

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

Source from the content-addressed store, hash-verified

596 assert body.read() == b"data"
597
598 def test_rewind_body_failed_tell(self) -> None:
599 body = io.BytesIO(b"test data")
600 body.read() # Consume body
601
602 # Simulate failed tell()
603 body_pos = _FAILEDTELL
604 with pytest.raises(UnrewindableBodyError):
605 rewind_body(body, body_pos)
606
607 def test_rewind_body_bad_position(self) -> None:
608 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