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

Method test_writelines

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

Source from the content-addressed store, hash-verified

1295 self.assertTrue(f._rolled)
1296
1297 def test_writelines(self):
1298 # Verify writelines with a SpooledTemporaryFile
1299 f = self.do_create()
1300 f.writelines((b'x', b'y', b'z'))
1301 pos = f.seek(0)
1302 self.assertEqual(pos, 0)
1303 buf = f.read()
1304 self.assertEqual(buf, b'xyz')
1305
1306 def test_writelines_rollover(self):
1307 # 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