Home / Function/ test_empty_stream_with_auth_does_not_set_content_length_header() — requests Function Reference

test_empty_stream_with_auth_does_not_set_content_length_header() — requests Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  4414dc55_f137_9ec4_5a2a_ed10b361a054["test_empty_stream_with_auth_does_not_set_content_length_header()"]
  22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"]
  4414dc55_f137_9ec4_5a2a_ed10b361a054 -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14
  style 4414dc55_f137_9ec4_5a2a_ed10b361a054 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 2197–2207

    def test_empty_stream_with_auth_does_not_set_content_length_header(self, httpbin):
        """Ensure that a byte stream with size 0 will not set both a Content-Length
        and Transfer-Encoding header.
        """
        auth = ("user", "pass")
        url = httpbin("post")
        file_obj = io.BytesIO(b"")
        r = requests.Request("POST", url, auth=auth, data=file_obj)
        prepared_request = r.prepare()
        assert "Transfer-Encoding" in prepared_request.headers
        assert "Content-Length" not in prepared_request.headers

Domain

Subdomains

Frequently Asked Questions

What does test_empty_stream_with_auth_does_not_set_content_length_header() do?
test_empty_stream_with_auth_does_not_set_content_length_header() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_empty_stream_with_auth_does_not_set_content_length_header() defined?
test_empty_stream_with_auth_does_not_set_content_length_header() is defined in tests/test_requests.py at line 2197.

Analyze Your Own Codebase

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

Try Supermodel Free