Home / Function/ test_session_get_adapter_prefix_with_trailing_slash() — requests Function Reference

test_session_get_adapter_prefix_with_trailing_slash() — requests Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_requests.py lines 1697–1708

    def test_session_get_adapter_prefix_with_trailing_slash(self):
        # from issue #6935
        prefix = "https://example.com/"  # trailing slash
        url_matching_prefix = "https://example.com/some/path"
        url_not_matching_prefix = "https://example.com.other.com/some/path"

        s = requests.Session()
        adapter = HTTPAdapter()
        s.mount(prefix, adapter)

        assert s.get_adapter(url_matching_prefix) is adapter
        assert s.get_adapter(url_not_matching_prefix) is not adapter

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free