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

Method test_iteration

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

Source from the content-addressed store, hash-verified

629 self.assertEqual(url, "http://localhost:%s" % handler.port)
630
631 def test_iteration(self):
632 expected_response = b"pycon 2008..."
633 handler = self.start_server([(200, [], expected_response)])
634 data = urllib.request.urlopen("http://localhost:%s" % handler.port)
635 for line in data:
636 self.assertEqual(line, expected_response)
637
638 def test_line_iteration(self):
639 lines = [b"We\n", b"got\n", b"here\n", b"verylong " * 8192 + b"\n"]

Callers

nothing calls this directly

Calls 3

start_serverMethod · 0.95
urlopenMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected