MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_proxy_basic_auth

Method test_proxy_basic_auth

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

Source from the content-addressed store, hash-verified

1629 self.check_basic_auth(headers, realm)
1630
1631 def test_proxy_basic_auth(self):
1632 opener = OpenerDirector()
1633 ph = urllib.request.ProxyHandler(dict(http="proxy.example.com:3128"))
1634 opener.add_handler(ph)
1635 password_manager = MockPasswordManager()
1636 auth_handler = urllib.request.ProxyBasicAuthHandler(password_manager)
1637 realm = "ACME Networks"
1638 http_handler = MockHTTPHandlerRedirect(
1639 407, 'Proxy-Authenticate: Basic realm="%s"\r\n\r\n' % realm)
1640 opener.add_handler(auth_handler)
1641 opener.add_handler(http_handler)
1642 self._test_basic_auth(opener, auth_handler, "Proxy-authorization",
1643 realm, http_handler, password_manager,
1644 "http://acme.example.com:3128/protected",
1645 "proxy.example.com:3128",
1646 )
1647
1648 def test_basic_and_digest_auth_handlers(self):
1649 # HTTPDigestAuthHandler raised an exception if it couldn't handle a 40*

Callers

nothing calls this directly

Calls 5

add_handlerMethod · 0.95
_test_basic_authMethod · 0.95
OpenerDirectorClass · 0.90
MockPasswordManagerClass · 0.85

Tested by

no test coverage detected