(self)
| 1463 | [tup[0:2] for tup in o.calls]) |
| 1464 | |
| 1465 | def test_proxy_no_proxy(self): |
| 1466 | env = self.enterContext(os_helper.EnvironmentVarGuard()) |
| 1467 | env['no_proxy'] = 'python.org' |
| 1468 | o = OpenerDirector() |
| 1469 | ph = urllib.request.ProxyHandler(dict(http="proxy.example.com")) |
| 1470 | o.add_handler(ph) |
| 1471 | req = Request("http://www.perl.org/") |
| 1472 | self.assertEqual(req.host, "www.perl.org") |
| 1473 | o.open(req) |
| 1474 | self.assertEqual(req.host, "proxy.example.com") |
| 1475 | req = Request("http://www.python.org") |
| 1476 | self.assertEqual(req.host, "www.python.org") |
| 1477 | o.open(req) |
| 1478 | self.assertEqual(req.host, "www.python.org") |
| 1479 | |
| 1480 | def test_proxy_no_proxy_all(self): |
| 1481 | env = self.enterContext(os_helper.EnvironmentVarGuard()) |
nothing calls this directly
no test coverage detected