MCPcopy Create free account
hub / github.com/python/cpython / test_read_one_by_one

Method test_read_one_by_one

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

Source from the content-addressed store, hash-verified

746 self.assertRaises(OSError, txt.read)
747
748 def test_read_one_by_one(self):
749 txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB"), encoding="utf-8")
750 reads = ""
751 while True:
752 c = txt.read(1)
753 if not c:
754 break
755 reads += c
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")

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected