MCPcopy
hub / github.com/urllib3/urllib3 / test_rewind_body_bad_position

Method test_rewind_body_bad_position

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

Source from the content-addressed store, hash-verified

605 rewind_body(body, body_pos)
606
607 def test_rewind_body_bad_position(self) -> None:
608 body = io.BytesIO(b"test data")
609 body.read() # Consume body
610
611 # Pass non-integer position
612 with pytest.raises(ValueError):
613 rewind_body(body, body_pos=None) # type: ignore[arg-type]
614 with pytest.raises(ValueError):
615 rewind_body(body, body_pos=object()) # type: ignore[arg-type]
616
617 def test_rewind_body_failed_seek(self) -> None:
618 class BadSeek(io.StringIO):

Callers

nothing calls this directly

Calls 2

rewind_bodyFunction · 0.90
readMethod · 0.45

Tested by

no test coverage detected