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

Method test_read_non_blocking

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

Source from the content-addressed store, hash-verified

1645 self.assertEqual(rawio.read_history, raw_read_sizes)
1646
1647 def test_read_non_blocking(self):
1648 # Inject some None's in there to simulate EWOULDBLOCK
1649 rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None))
1650 bufio = self.tp(rawio)
1651 self.assertEqual(b"abcd", bufio.read(6))
1652 self.assertEqual(b"e", bufio.read(1))
1653 self.assertEqual(b"fg", bufio.read())
1654 self.assertEqual(b"", bufio.peek(1))
1655 self.assertIsNone(bufio.read())
1656 self.assertEqual(b"", bufio.read())
1657
1658 rawio = self.MockRawIO((b"a", None, None))
1659 self.assertEqual(b"a", rawio.readall())
1660 self.assertIsNone(rawio.readall())
1661
1662 def test_read_past_eof(self):
1663 rawio = self.MockRawIO((b"abc", b"d", b"efg"))

Callers

nothing calls this directly

Calls 5

assertIsNoneMethod · 0.80
assertEqualMethod · 0.45
readMethod · 0.45
peekMethod · 0.45
readallMethod · 0.45

Tested by

no test coverage detected