MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_line_iteration

Method test_line_iteration

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

Source from the content-addressed store, hash-verified

653
654
655 def test_line_iteration(self):
656 lines = [b"We\n", b"got\n", b"here\n", b"verylong " * 8192 + b"\n"]
657 expected_response = b"".join(lines)
658 handler = self.start_server([(200, [], expected_response)])
659 data = urllib.request.urlopen("http://localhost:%s" % handler.port)
660 for index, line in enumerate(data):
661 self.assertEqual(line, lines[index],
662 "Fetched line number %s doesn't match expected:\n"
663 " Expected length was %s, got %s" %
664 (index, len(lines[index]), len(line)))
665 self.assertEqual(index + 1, len(lines))
666
667
668 def test_issue16464(self):

Callers

nothing calls this directly

Calls 6

start_serverMethod · 0.95
enumerateFunction · 0.85
lenFunction · 0.85
joinMethod · 0.45
urlopenMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected