Home / Function/ test_rewind_body_failed_seek() — requests Function Reference

test_rewind_body_failed_seek() — requests Function Reference

Architecture documentation for the test_rewind_body_failed_seek() function in test_requests.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  614bec73_7070_9883_cbd0_8909e0af424d["test_rewind_body_failed_seek()"]
  22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"]
  614bec73_7070_9883_cbd0_8909e0af424d -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14
  f7250866_7829_1b43_7b16_dc94f5dabdf9["tell()"]
  614bec73_7070_9883_cbd0_8909e0af424d -->|calls| f7250866_7829_1b43_7b16_dc94f5dabdf9
  55441dc1_36b2_4d2b_bb99_c396f5c2ff8d["seek()"]
  614bec73_7070_9883_cbd0_8909e0af424d -->|calls| 55441dc1_36b2_4d2b_bb99_c396f5c2ff8d
  style 614bec73_7070_9883_cbd0_8909e0af424d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 2020–2041

    def test_rewind_body_failed_seek(self):
        class BadFileObj:
            def __init__(self, data):
                self.data = data

            def tell(self):
                return 0

            def seek(self, pos, whence=0):
                raise OSError()

            def __iter__(self):
                return

        data = BadFileObj("the data")
        prep = requests.Request("GET", "http://example.com", data=data).prepare()
        assert prep._body_position == 0

        with pytest.raises(UnrewindableBodyError) as e:
            requests.utils.rewind_body(prep)

        assert "error occurred when rewinding request body" in str(e)

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_rewind_body_failed_seek() do?
test_rewind_body_failed_seek() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_rewind_body_failed_seek() defined?
test_rewind_body_failed_seek() is defined in tests/test_requests.py at line 2020.
What does test_rewind_body_failed_seek() call?
test_rewind_body_failed_seek() calls 2 function(s): seek, tell.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free