MCPcopy Index your code
hub / github.com/python/cpython / test_proxy_no_proxy_all

Method test_proxy_no_proxy_all

Lib/test/test_urllib2.py:1480–1489  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1478 self.assertEqual(req.host, "www.python.org")
1479
1480 def test_proxy_no_proxy_all(self):
1481 env = self.enterContext(os_helper.EnvironmentVarGuard())
1482 env['no_proxy'] = '*'
1483 o = OpenerDirector()
1484 ph = urllib.request.ProxyHandler(dict(http="proxy.example.com"))
1485 o.add_handler(ph)
1486 req = Request("http://www.python.org")
1487 self.assertEqual(req.host, "www.python.org")
1488 o.open(req)
1489 self.assertEqual(req.host, "www.python.org")
1490
1491 def test_proxy_https(self):
1492 o = OpenerDirector()

Callers

nothing calls this directly

Calls 6

add_handlerMethod · 0.95
openMethod · 0.95
OpenerDirectorClass · 0.90
RequestClass · 0.90
enterContextMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected