Home / Function/ test_rewind_partially_read_body() — requests Function Reference

test_rewind_partially_read_body() — requests Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  402d8f7b_cfe1_dad0_af75_764ef70e7645["test_rewind_partially_read_body()"]
  22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"]
  402d8f7b_cfe1_dad0_af75_764ef70e7645 -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14
  e661d358_be18_74b3_7f2e_30e0b47b69b3["read()"]
  402d8f7b_cfe1_dad0_af75_764ef70e7645 -->|calls| e661d358_be18_74b3_7f2e_30e0b47b69b3
  style 402d8f7b_cfe1_dad0_af75_764ef70e7645 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 1986–1998

    def test_rewind_partially_read_body(self):
        data = io.BytesIO(b"the data")
        data.read(4)  # read some data
        prep = requests.Request("GET", "http://example.com", data=data).prepare()
        assert prep._body_position == 4
        assert prep.body.read() == b"data"

        # the data has all been read
        assert prep.body.read() == b""

        # rewind it back
        requests.utils.rewind_body(prep)
        assert prep.body.read() == b"data"

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_rewind_partially_read_body() do?
test_rewind_partially_read_body() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_rewind_partially_read_body() defined?
test_rewind_partially_read_body() is defined in tests/test_requests.py at line 1986.
What does test_rewind_partially_read_body() call?
test_rewind_partially_read_body() calls 1 function(s): read.

Analyze Your Own Codebase

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

Try Supermodel Free