diff options
author | Sergey Shepelev <temotor@gmail.com> | 2018-03-19 22:40:28 +0300 |
---|---|---|
committer | Sergey Shepelev <temotor@gmail.com> | 2018-03-20 22:17:49 +0300 |
commit | 12b26f92e308cbfa593dcf6e1d6c794e40876928 (patch) | |
tree | 7775b87682fcaca45b3d7e285283e3dae295945d /tests | |
parent | ea67159a013e6cd014bc31241b7572e60530a240 (diff) | |
download | httplib2-12b26f92e308cbfa593dcf6e1d6c794e40876928.tar.gz |
proxy: no_proxy=bar was matching foobar
https://github.com/httplib2/httplib2/issues/94
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_proxy.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_proxy.py b/tests/test_proxy.py index d1bdb66..3f1622e 100644 --- a/tests/test_proxy.py +++ b/tests/test_proxy.py @@ -46,11 +46,15 @@ def test_from_env_none(): def test_applies_to(): os.environ['http_proxy'] = 'http://myproxy.example.com:80' os.environ['https_proxy'] = 'http://myproxy.example.com:81' - os.environ['no_proxy'] = 'localhost,otherhost.domain.local,example.com' + os.environ['no_proxy'] = 'localhost,example.com,.wildcard' pi = httplib2.proxy_info_from_environment() assert not pi.applies_to('localhost') assert pi.applies_to('www.google.com') - assert not pi.applies_to('www.example.com') + assert pi.applies_to('prefixlocalhost') + assert pi.applies_to('www.example.com') + assert pi.applies_to('sub.example.com') + assert not pi.applies_to('sub.wildcard') + assert not pi.applies_to('pub.sub.wildcard') def test_noproxy_trailing_comma(): |