summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2009-07-26 12:39:47 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2009-07-26 12:39:47 (GMT)
commit0ac1f83079ee90f56bc7eef92643980a911bd355 (patch)
tree2ce2674de89d07f83132467448a9af38c0f4d29d /Lib/test/test_urllib2.py
parent36613e08c3bec90e975eef9bdd3c9f2082a68616 (diff)
downloadcpython-0ac1f83079ee90f56bc7eef92643980a911bd355.zip
cpython-0ac1f83079ee90f56bc7eef92643980a911bd355.tar.gz
cpython-0ac1f83079ee90f56bc7eef92643980a911bd355.tar.bz2
Backport the changes made in revision 74198, fixing the issue 1424152
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 5c9cb8c..87d0116 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -947,6 +947,23 @@ class HandlerTests(unittest.TestCase):
self.assertEqual([(handlers[0], "http_open")],
[tup[0:2] for tup in o.calls])
+ def test_proxy_https(self):
+ o = OpenerDirector()
+ ph = urllib.request.ProxyHandler(dict(https="proxy.example.com:3128"))
+ o.add_handler(ph)
+ meth_spec = [
+ [("https_open", "return response")]
+ ]
+ handlers = add_ordered_mock_handlers(o, meth_spec)
+
+ req = Request("https://www.example.com/")
+ self.assertEqual(req.get_host(), "www.example.com")
+ r = o.open(req)
+ self.assertEqual(req.get_host(), "proxy.example.com:3128")
+ self.assertEqual([(handlers[0], "https_open")],
+ [tup[0:2] for tup in o.calls])
+
+
def test_basic_auth(self, quote_char='"'):
opener = OpenerDirector()
password_manager = MockPasswordManager()