(self)
| 1446 | [tup[0:2] for tup in o.calls]) |
| 1447 | |
| 1448 | def test_proxy_no_proxy(self): |
| 1449 | env = self.enterContext(os_helper.EnvironmentVarGuard()) |
| 1450 | env['no_proxy'] = 'python.org' |
| 1451 | o = OpenerDirector() |
| 1452 | ph = urllib.request.ProxyHandler(dict(http="proxy.example.com")) |
| 1453 | o.add_handler(ph) |
| 1454 | req = Request("http://www.perl.org/") |
| 1455 | self.assertEqual(req.host, "www.perl.org") |
| 1456 | o.open(req) |
| 1457 | self.assertEqual(req.host, "proxy.example.com") |
| 1458 | req = Request("http://www.python.org") |
| 1459 | self.assertEqual(req.host, "www.python.org") |
| 1460 | o.open(req) |
| 1461 | self.assertEqual(req.host, "www.python.org") |
| 1462 | |
| 1463 | def test_proxy_no_proxy_all(self): |
| 1464 | env = self.enterContext(os_helper.EnvironmentVarGuard()) |
nothing calls this directly
no test coverage detected