Home / Function/ test_basicauth_encodes_byte_strings() — requests Function Reference

test_basicauth_encodes_byte_strings() — requests Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_requests.py lines 564–572

    def test_basicauth_encodes_byte_strings(self):
        """Ensure b'test' formats as the byte string "test" rather
        than the unicode string "b'test'" in Python 3.
        """
        auth = (b"\xc5\xafsername", b"test\xc6\xb6")
        r = requests.Request("GET", "http://localhost", auth=auth)
        p = r.prepare()

        assert p.headers["Authorization"] == "Basic xa9zZXJuYW1lOnRlc3TGtg=="

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free