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

Method test_readlines

Lib/test/test_io/test_textio.py:758–764  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

756 self.assertEqual(reads, "AA\nBB")
757
758 def test_readlines(self):
759 txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC"), encoding="utf-8")
760 self.assertEqual(txt.readlines(), ["AA\n", "BB\n", "CC"])
761 txt.seek(0)
762 self.assertEqual(txt.readlines(None), ["AA\n", "BB\n", "CC"])
763 txt.seek(0)
764 self.assertEqual(txt.readlines(5), ["AA\n", "BB\n"])
765
766 # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128.
767 def test_read_by_chunk(self):

Callers

nothing calls this directly

Calls 3

seekMethod · 0.95
assertEqualMethod · 0.45
readlinesMethod · 0.45

Tested by

no test coverage detected