mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Backporting the changes made in revision 72880 as fix for Issue1424152.
This commit is contained in:
parent
47ccf0cbba
commit
308681c405
4 changed files with 60 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue