(self)
| 1472 | self.assertEqual(req.host, "www.python.org") |
| 1473 | |
| 1474 | def test_proxy_https(self): |
| 1475 | o = OpenerDirector() |
| 1476 | ph = urllib.request.ProxyHandler(dict(https="proxy.example.com:3128")) |
| 1477 | o.add_handler(ph) |
| 1478 | meth_spec = [ |
| 1479 | [("https_open", "return response")] |
| 1480 | ] |
| 1481 | handlers = add_ordered_mock_handlers(o, meth_spec) |
| 1482 | |
| 1483 | req = Request("https://www.example.com/") |
| 1484 | self.assertEqual(req.host, "www.example.com") |
| 1485 | o.open(req) |
| 1486 | self.assertEqual(req.host, "proxy.example.com:3128") |
| 1487 | self.assertEqual([(handlers[0], "https_open")], |
| 1488 | [tup[0:2] for tup in o.calls]) |
| 1489 | |
| 1490 | @unittest.skipUnless(hasattr(http.client, 'HTTPSConnection'), 'HTTPSConnection required for HTTPS tests.') |
| 1491 | def test_proxy_https_proxy_authorization(self): |
nothing calls this directly
no test coverage detected