Skip to content
Myr

Add test for per-host proxy selection

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

authored by Jason Grout · committed by Jason Grout · parent c80121d · Browse files · 1 file+9 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+9 added−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:test_requests.py+9 added
1323 unmodified lines
1324 assert get_environ_proxies(1325 'http://localhost.localdomain:5000/v1.0/') == {}1326 assert get_environ_proxies('http://www.requests.com/') != {}13271328 def test_select_proxies(self):1329 """Make sure we can select per-host proxies correctly."""1330 from requests.utils import select_proxy1331 proxies = {'http': 'http://http.proxy',1332 'http://some.host': 'http://some.host.proxy'}1333 assert select_proxy('hTTp://u:p@Some.Host/path', proxies) == 'http://some.host.proxy'1334 assert select_proxy('hTTp://u:p@Other.Host/path', proxies) == 'http://http.proxy'1335 assert select_proxy('hTTps://Other.Host', proxies) is None13361337 def test_guess_filename_when_int(self):1338 from requests.utils import guess_filename1339 assert None is guess_filename(1)1340
335 unmodified lines