mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Added test for domain name no_proxy matching.
This commit is contained in:
Generated
+3
@@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="kmadac" />
|
||||
</component>
|
||||
@@ -917,7 +917,15 @@ class UtilsTestCase(unittest.TestCase):
|
||||
assert get_environ_proxies('http://192.168.0.1:5000/') == {}
|
||||
assert get_environ_proxies('http://192.168.0.1/') == {}
|
||||
assert get_environ_proxies('http://172.16.1.1/') == {}
|
||||
assert get_environ_proxies('http://172.16.1.1:5000/') == {}
|
||||
assert get_environ_proxies('http://192.168.1.1:5000/') == {'no': os.environ['no_proxy']}
|
||||
|
||||
def test_get_environ_proxies(self):
|
||||
""" Ensures that IP addresses are correctly matches with ranges in no_proxy variable """
|
||||
from requests.utils import get_environ_proxies
|
||||
os.environ['no_proxy'] = "127.0.0.1,localhost.localdomain,192.168.0.0/24,172.16.1.1"
|
||||
assert get_environ_proxies('http://localhost.localdomain:5000/test/') == {}
|
||||
assert get_environ_proxies('http://www.requests.com/') == {'no': os.environ['no_proxy']}
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user