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

Method test_writelines

Lib/test/test_tempfile.py:1278–1285  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1276 self.assertTrue(f._rolled)
1277
1278 def test_writelines(self):
1279 # Verify writelines with a SpooledTemporaryFile
1280 f = self.do_create()
1281 f.writelines((b'x', b'y', b'z'))
1282 pos = f.seek(0)
1283 self.assertEqual(pos, 0)
1284 buf = f.read()
1285 self.assertEqual(buf, b'xyz')
1286
1287 def test_writelines_rollover(self):
1288 # Verify writelines rolls over before exhausting the iterator

Callers

nothing calls this directly

Calls 5

do_createMethod · 0.95
writelinesMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected