(self)
| 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* |
nothing calls this directly
no test coverage detected