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

Method test_flush_and_write

Lib/test/test_io/test_bufferedio.py:1314–1324  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1312 self.check_flush_and_read(_peek)
1313
1314 def test_flush_and_write(self):
1315 raw = self.BytesIO(b"abcdefghi")
1316 bufio = self.tp(raw)
1317
1318 bufio.write(b"123")
1319 bufio.flush()
1320 bufio.write(b"45")
1321 bufio.flush()
1322 bufio.seek(0, 0)
1323 self.assertEqual(b"12345fghi", raw.getvalue())
1324 self.assertEqual(b"12345fghi", bufio.read())
1325
1326 def test_threads(self):
1327 BufferedReaderTest.test_threads(self)

Callers

nothing calls this directly

Calls 6

getvalueMethod · 0.95
writeMethod · 0.45
flushMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected