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

Method test_basic_auth_success

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

Source from the content-addressed store, hash-verified

304 super(BasicAuthTests, self).tearDown()
305
306 def test_basic_auth_success(self):
307 ah = urllib.request.HTTPBasicAuthHandler()
308 ah.add_password(self.REALM, self.server_url, self.USER, self.PASSWD)
309 urllib.request.install_opener(urllib.request.build_opener(ah))
310 try:
311 self.assertTrue(urllib.request.urlopen(self.server_url))
312 except urllib.error.HTTPError:
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()

Callers

nothing calls this directly

Calls 4

assertTrueMethod · 0.80
add_passwordMethod · 0.45
urlopenMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected