summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2009-07-26 12:36:08 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2009-07-26 12:36:08 (GMT)
commit308681c405177dd893384bb039854c08c88e852c (patch)
tree8299437012b95b64095856315257dc792586b347 /Lib/test/test_urllib2.py
parent47ccf0cbbaa4797d9d32c51c70d51a711a8d5fe0 (diff)
downloadcpython-308681c405177dd893384bb039854c08c88e852c.zip
cpython-308681c405177dd893384bb039854c08c88e852c.tar.gz
cpython-308681c405177dd893384bb039854c08c88e852c.tar.bz2
Backporting the changes made in revision 72880 as fix for Issue1424152.
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index fe5688b..b83eb46 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -943,6 +943,21 @@ 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 = urllib2.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()