Skip to content
Myr

Add test for Session.get_adapter() case-insensitivity

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

authored by Alvaro Gutierrez Perez · committed by Alvaro Gutierrez Perez · parent d3f14af · Browse files · 1 file+12 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+12 added−0 removed

  • tests:+12 added−0 removed

1 file+12 added−0 removed

modified:tests/test_requests.py+12 added
1349 unmodified lines
1350 s2.mount('https://', HTTPAdapter())1351 assert 'http://' in s2.adapters1352 assert 'https://' in s2.adapters13531354 def test_session_get_adapter_prefix_matching_is_case_insensitive(self, httpbin):1355 mixed_case_prefix = 'hTtPs://eXamPle.CoM/MixEd_CAse_PREfix'1356 url_matching_prefix = mixed_case_prefix + '/full_url'1357 url_matching_prefix_with_different_case = 'HtTpS://exaMPLe.cOm/MiXeD_caSE_preFIX/another_url'13581359 s = requests.Session()1360 my_adapter = HTTPAdapter()1361 s.mount(mixed_case_prefix, my_adapter)13621363 assert s.get_adapter(url_matching_prefix) is my_adapter1364 assert s.get_adapter(url_matching_prefix_with_different_case) is my_adapter13651366 def test_header_remove_is_case_insensitive(self, httpbin):1367 # From issue #13211368 s = requests.Session()1369 s.headers['foo'] = 'bar'
1032 unmodified lines