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

Method test_read_by_chunk

Lib/test/test_io.py:3427–3436  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3425
3426 # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128.
3427 def test_read_by_chunk(self):
3428 # make sure "\r\n" straddles 128 char boundary.
3429 txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB"), encoding="utf-8")
3430 reads = ""
3431 while True:
3432 c = txt.read(128)
3433 if not c:
3434 break
3435 reads += c
3436 self.assertEqual(reads, "A"*127+"\nB")
3437
3438 def test_writelines(self):
3439 l = ['ab', 'cd', 'ef']

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected