(self)
| 1657 | assert "https://" in s2.adapters |
| 1658 | |
| 1659 | def test_session_get_adapter_prefix_matching(self): |
| 1660 | prefix = "https://example.com" |
| 1661 | more_specific_prefix = prefix + "/some/path" |
| 1662 | |
| 1663 | url_matching_only_prefix = prefix + "/another/path" |
| 1664 | url_matching_more_specific_prefix = more_specific_prefix + "/longer/path" |
| 1665 | url_not_matching_prefix = "https://another.example.com/" |
| 1666 | |
| 1667 | s = requests.Session() |
| 1668 | prefix_adapter = HTTPAdapter() |
| 1669 | more_specific_prefix_adapter = HTTPAdapter() |
| 1670 | s.mount(prefix, prefix_adapter) |
| 1671 | s.mount(more_specific_prefix, more_specific_prefix_adapter) |
| 1672 | |
| 1673 | assert s.get_adapter(url_matching_only_prefix) is prefix_adapter |
| 1674 | assert ( |
| 1675 | s.get_adapter(url_matching_more_specific_prefix) |
| 1676 | is more_specific_prefix_adapter |
| 1677 | ) |
| 1678 | assert s.get_adapter(url_not_matching_prefix) not in ( |
| 1679 | prefix_adapter, |
| 1680 | more_specific_prefix_adapter, |
| 1681 | ) |
| 1682 | |
| 1683 | def test_session_get_adapter_prefix_matching_mixed_case(self): |
| 1684 | mixed_case_prefix = "hTtPs://eXamPle.CoM/MixEd_CAse_PREfix" |
nothing calls this directly
no test coverage detected