test_session_get_adapter_prefix_matching() — requests Function Reference
Architecture documentation for the test_session_get_adapter_prefix_matching() function in test_requests.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD fdf921b1_0617_a06d_789e_07ac4197b8cb["test_session_get_adapter_prefix_matching()"] 22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"] fdf921b1_0617_a06d_789e_07ac4197b8cb -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14 style fdf921b1_0617_a06d_789e_07ac4197b8cb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_requests.py lines 1651–1673
def test_session_get_adapter_prefix_matching(self):
prefix = "https://example.com"
more_specific_prefix = prefix + "/some/path"
url_matching_only_prefix = prefix + "/another/path"
url_matching_more_specific_prefix = more_specific_prefix + "/longer/path"
url_not_matching_prefix = "https://another.example.com/"
s = requests.Session()
prefix_adapter = HTTPAdapter()
more_specific_prefix_adapter = HTTPAdapter()
s.mount(prefix, prefix_adapter)
s.mount(more_specific_prefix, more_specific_prefix_adapter)
assert s.get_adapter(url_matching_only_prefix) is prefix_adapter
assert (
s.get_adapter(url_matching_more_specific_prefix)
is more_specific_prefix_adapter
)
assert s.get_adapter(url_not_matching_prefix) not in (
prefix_adapter,
more_specific_prefix_adapter,
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_session_get_adapter_prefix_matching() do?
test_session_get_adapter_prefix_matching() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_session_get_adapter_prefix_matching() defined?
test_session_get_adapter_prefix_matching() is defined in tests/test_requests.py at line 1651.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free