test_response_chunk_size_type() — requests Function Reference
Architecture documentation for the test_response_chunk_size_type() function in test_requests.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD 6291516a_487b_832b_39fc_f640f85c28f5["test_response_chunk_size_type()"] 22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"] 6291516a_487b_832b_39fc_f640f85c28f5 -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14 style 6291516a_487b_832b_39fc_f640f85c28f5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_requests.py lines 1474–1491
def test_response_chunk_size_type(self):
"""Ensure that chunk_size is passed as None or an integer, otherwise
raise a TypeError.
"""
r = requests.Response()
r.raw = io.BytesIO(b"the content")
chunks = r.iter_content(1)
assert all(len(chunk) == 1 for chunk in chunks)
r = requests.Response()
r.raw = io.BytesIO(b"the content")
chunks = r.iter_content(None)
assert list(chunks) == [b"the content"]
r = requests.Response()
r.raw = io.BytesIO(b"the content")
with pytest.raises(TypeError):
chunks = r.iter_content("1024")
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_response_chunk_size_type() do?
test_response_chunk_size_type() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_response_chunk_size_type() defined?
test_response_chunk_size_type() is defined in tests/test_requests.py at line 1474.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free