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

Method test_save

Lib/test/test_turtle.py:546–555  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

544 self.assertEqual(f.read(), "postscript")
545
546 def test_save(self) -> None:
547 screen = unittest.mock.Mock()
548 screen.cv.postscript.return_value = "postscript"
549
550 with tempfile.TemporaryDirectory() as tmpdir:
551 file_path = os.path.join(tmpdir, "some_file.ps")
552
553 turtle.TurtleScreen.save(screen, file_path)
554 with open(file_path) as f:
555 self.assertEqual(f.read(), "postscript")
556
557 def test_no_animation_sets_tracer_0(self):
558 s = turtle.TurtleScreen(cv=unittest.mock.MagicMock())

Callers

nothing calls this directly

Calls 5

openFunction · 0.50
joinMethod · 0.45
saveMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected