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

Method test_geturl

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

Source from the content-addressed store, hash-verified

621 self.assertEqual(info_obj.get_content_subtype(), "plain")
622
623 def test_geturl(self):
624 # Make sure same URL as opened is returned by geturl.
625 handler = self.start_server()
626 open_url = urllib.request.urlopen("http://localhost:%s" % handler.port)
627 with open_url:
628 url = open_url.geturl()
629 self.assertEqual(url, "http://localhost:%s" % handler.port)
630
631 def test_iteration(self):
632 expected_response = b"pycon 2008..."

Callers

nothing calls this directly

Calls 4

start_serverMethod · 0.95
urlopenMethod · 0.45
geturlMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected