(self)
| 1646 | self.check_basic_auth(headers, realm) |
| 1647 | |
| 1648 | def test_proxy_basic_auth(self): |
| 1649 | opener = OpenerDirector() |
| 1650 | ph = urllib.request.ProxyHandler(dict(http="proxy.example.com:3128")) |
| 1651 | opener.add_handler(ph) |
| 1652 | password_manager = MockPasswordManager() |
| 1653 | auth_handler = urllib.request.ProxyBasicAuthHandler(password_manager) |
| 1654 | realm = "ACME Networks" |
| 1655 | http_handler = MockHTTPHandlerRedirect( |
| 1656 | 407, 'Proxy-Authenticate: Basic realm="%s"\r\n\r\n' % realm) |
| 1657 | opener.add_handler(auth_handler) |
| 1658 | opener.add_handler(http_handler) |
| 1659 | self._test_basic_auth(opener, auth_handler, "Proxy-authorization", |
| 1660 | realm, http_handler, password_manager, |
| 1661 | "http://acme.example.com:3128/protected", |
| 1662 | "proxy.example.com:3128", |
| 1663 | ) |
| 1664 | |
| 1665 | def test_basic_and_digest_auth_handlers(self): |
| 1666 | # HTTPDigestAuthHandler raised an exception if it couldn't handle a 40* |
nothing calls this directly
no test coverage detected