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

Method test_unsupported_auth_basic_handler

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

Source from the content-addressed store, hash-verified

1723 self.assertRaises(ValueError, opener.open, "http://www.example.com")
1724
1725 def test_unsupported_auth_basic_handler(self):
1726 # While using BasicAuthHandler
1727 opener = OpenerDirector()
1728 basic_auth_handler = urllib.request.HTTPBasicAuthHandler(None)
1729 http_handler = MockHTTPHandlerRedirect(
1730 401, 'WWW-Authenticate: NTLM\r\n\r\n')
1731 opener.add_handler(basic_auth_handler)
1732 opener.add_handler(http_handler)
1733 self.assertRaises(ValueError, opener.open, "http://www.example.com")
1734
1735 def _test_basic_auth(self, opener, auth_handler, auth_header,
1736 realm, http_handler, password_manager,

Callers

nothing calls this directly

Calls 4

add_handlerMethod · 0.95
OpenerDirectorClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected