Skip to content
Myr

Add two more tests exercising the adapter (#6936)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Closes #6935

authored by Robin · committed by GitHub · parent 579cd9f · Browse files · 1 file+26 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+26 added−0 removed

  • tests:+26 added−0 removed

1 file+26 added−0 removed

modified:tests/test_requests.py+26 added
1661 unmodified lines
1662 s.mount(mixed_case_prefix, my_adapter)16631664 assert s.get_adapter(url_matching_prefix_with_different_case) is my_adapter16651666 def test_session_get_adapter_prefix_with_trailing_slash(self):1667 # from issue #69351668 prefix = "https://example.com/" # trailing slash1669 url_matching_prefix = "https://example.com/some/path"1670 url_not_matching_prefix = "https://example.com.other.com/some/path"16711672 s = requests.Session()1673 adapter = HTTPAdapter()1674 s.mount(prefix, adapter)16751676 assert s.get_adapter(url_matching_prefix) is adapter1677 assert s.get_adapter(url_not_matching_prefix) is not adapter16781679 def test_session_get_adapter_prefix_without_trailing_slash(self):1680 # from issue #69351681 prefix = "https://example.com" # no trailing slash1682 url_matching_prefix = "https://example.com/some/path"1683 url_extended_hostname = "https://example.com.other.com/some/path"16841685 s = requests.Session()1686 adapter = HTTPAdapter()1687 s.mount(prefix, adapter)16881689 assert s.get_adapter(url_matching_prefix) is adapter1690 assert s.get_adapter(url_extended_hostname) is adapter16911692 def test_header_remove_is_case_insensitive(self, httpbin):1693 # From issue #13211694 s = requests.Session()1695 s.headers["foo"] = "bar"
1314 unmodified lines