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

Method test_info

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

Source from the content-addressed store, hash-verified

610 self.assertTrue(open_url.read(), "calling 'read' failed")
611
612 def test_info(self):
613 handler = self.start_server()
614 open_url = urllib.request.urlopen(
615 "http://localhost:%s" % handler.port)
616 with open_url:
617 info_obj = open_url.info()
618 self.assertIsInstance(info_obj, email.message.Message,
619 "object returned by 'info' is not an "
620 "instance of email.message.Message")
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.

Callers

nothing calls this directly

Calls 6

start_serverMethod · 0.95
assertIsInstanceMethod · 0.80
get_content_subtypeMethod · 0.80
urlopenMethod · 0.45
infoMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected