(self)
| 1489 | self.assertEqual(req.host, "www.python.org") |
| 1490 | |
| 1491 | def test_proxy_https(self): |
| 1492 | o = OpenerDirector() |
| 1493 | ph = urllib.request.ProxyHandler(dict(https="proxy.example.com:3128")) |
| 1494 | o.add_handler(ph) |
| 1495 | meth_spec = [ |
| 1496 | [("https_open", "return response")] |
| 1497 | ] |
| 1498 | handlers = add_ordered_mock_handlers(o, meth_spec) |
| 1499 | |
| 1500 | req = Request("https://www.example.com/") |
| 1501 | self.assertEqual(req.host, "www.example.com") |
| 1502 | o.open(req) |
| 1503 | self.assertEqual(req.host, "proxy.example.com:3128") |
| 1504 | self.assertEqual([(handlers[0], "https_open")], |
| 1505 | [tup[0:2] for tup in o.calls]) |
| 1506 | |
| 1507 | @unittest.skipUnless(hasattr(http.client, 'HTTPSConnection'), 'HTTPSConnection required for HTTPS tests.') |
| 1508 | def test_proxy_https_proxy_authorization(self): |
nothing calls this directly
no test coverage detected