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

Method test_RawIOBase_read

Lib/test/test_io/test_general.py:583–594  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

581 self.assertRaises(ValueError, f.flush)
582
583 def test_RawIOBase_read(self):
584 # Exercise the default limited RawIOBase.read(n) implementation (which
585 # calls readinto() internally).
586 rawio = self.MockRawIOWithoutRead((b"abc", b"d", None, b"efg", None))
587 self.assertEqual(rawio.read(2), b"ab")
588 self.assertEqual(rawio.read(2), b"c")
589 self.assertEqual(rawio.read(2), b"d")
590 self.assertEqual(rawio.read(2), None)
591 self.assertEqual(rawio.read(2), b"ef")
592 self.assertEqual(rawio.read(2), b"g")
593 self.assertEqual(rawio.read(2), None)
594 self.assertEqual(rawio.read(2), b"")
595
596 def test_RawIOBase_read_bounds_checking(self):
597 # Make sure a `.readinto` call which returns a value outside

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected