From 9fb3bfd817fcca5133ae1ea7e8908c6004d9cef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20B=C3=BArigo=20Zacar=C3=A3o?= Date: Fri, 13 Dec 2019 10:42:47 -0800 Subject: [PATCH] Update proxy tests with RFC 3986 complaint URIs Background: urllib3 1.25 has updated urllib3.utils.parse_url() and now requires RFC 3986 compliant URI structures to be passed to it. --- tests/test_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index b0aa849d..15fc7389 100755 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -79,7 +79,7 @@ def test_makes_request_with_proxy(self, mock_manager): # Test http host = 'http://whynotestsforthisstuff.com' - with patch.dict(os.environ, {'http_proxy': 'host:333'}): + with patch.dict(os.environ, {'http_proxy': 'proxy.host:333'}): utils.make_request( 'GET', host, @@ -89,12 +89,12 @@ def test_makes_request_with_proxy(self, mock_manager): ) mock_manager.assert_called_once_with(num_pools=1, proxy_headers=Any(), - proxy_url='http://host:333') + proxy_url='http://proxy.host:333') mock_connection.request.assert_called_once() # Test https host = 'https://whynotestsforthisstuff.com' - with patch.dict(os.environ, {'https_proxy': 'host:333'}): + with patch.dict(os.environ, {'https_proxy': 'proxy.host:333'}): utils.make_request( 'GET', host, @@ -104,7 +104,7 @@ def test_makes_request_with_proxy(self, mock_manager): ) mock_manager.assert_called_with(num_pools=1, proxy_headers=Any(), - proxy_url='https://host:333', + proxy_url='https://proxy.host:333', ca_certs=Any(), cert_reqs=Any()) self.assertEqual(mock_connection.request.call_count, 2)