Home / Function/ test_transport_adapter_ordering() — requests Function Reference

test_transport_adapter_ordering() — requests Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_requests.py lines 1613–1649

    def test_transport_adapter_ordering(self):
        s = requests.Session()
        order = ["https://", "http://"]
        assert order == list(s.adapters)
        s.mount("http://git", HTTPAdapter())
        s.mount("http://github", HTTPAdapter())
        s.mount("http://github.com", HTTPAdapter())
        s.mount("http://github.com/about/", HTTPAdapter())
        order = [
            "http://github.com/about/",
            "http://github.com",
            "http://github",
            "http://git",
            "https://",
            "http://",
        ]
        assert order == list(s.adapters)
        s.mount("http://gittip", HTTPAdapter())
        s.mount("http://gittip.com", HTTPAdapter())
        s.mount("http://gittip.com/about/", HTTPAdapter())
        order = [
            "http://github.com/about/",
            "http://gittip.com/about/",
            "http://github.com",
            "http://gittip.com",
            "http://github",
            "http://gittip",
            "http://git",
            "https://",
            "http://",
        ]
        assert order == list(s.adapters)
        s2 = requests.Session()
        s2.adapters = {"http://": HTTPAdapter()}
        s2.mount("https://", HTTPAdapter())
        assert "http://" in s2.adapters
        assert "https://" in s2.adapters

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free