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

Method test_basic_auth_httperror

Lib/test/test_urllib2_localnet.py:315–321  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

313 self.fail("Basic auth failed for the url: %s" % self.server_url)
314
315 def test_basic_auth_httperror(self):
316 ah = urllib.request.HTTPBasicAuthHandler()
317 ah.add_password(self.REALM, self.server_url, self.USER, self.INCORRECT_PASSWD)
318 urllib.request.install_opener(urllib.request.build_opener(ah))
319 with self.assertRaises(urllib.error.HTTPError) as cm:
320 urllib.request.urlopen(self.server_url)
321 cm.exception.close()
322
323
324@hashlib_helper.requires_hashdigest("md5", openssl=True)

Callers

nothing calls this directly

Calls 4

add_passwordMethod · 0.45
assertRaisesMethod · 0.45
urlopenMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected