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

Method test_read_by_chunk

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

Source from the content-addressed store, hash-verified

765
766 # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128.
767 def test_read_by_chunk(self):
768 # make sure "\r\n" straddles 128 char boundary.
769 txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB"), encoding="utf-8")
770 reads = ""
771 while True:
772 c = txt.read(128)
773 if not c:
774 break
775 reads += c
776 self.assertEqual(reads, "A"*127+"\nB")
777
778 def test_writelines(self):
779 l = ['ab', 'cd', 'ef']

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected