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

Method test_empty_file

Lib/test/test_shutil.py:3206–3217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3204 self.assertEqual(cm.exception.filename, name)
3205
3206 def test_empty_file(self):
3207 srcname = TESTFN + 'src'
3208 dstname = TESTFN + 'dst'
3209 self.addCleanup(lambda: os_helper.unlink(srcname))
3210 self.addCleanup(lambda: os_helper.unlink(dstname))
3211 create_file(srcname)
3212
3213 with open(srcname, "rb") as src:
3214 with open(dstname, "wb") as dst:
3215 self.zerocopy_fun(src, dst)
3216
3217 self.assertEqual(read_file(dstname, binary=True), b"")
3218
3219 def test_unhandled_exception(self):
3220 with unittest.mock.patch(self.PATCHPOINT,

Callers

nothing calls this directly

Calls 7

zerocopy_funMethod · 0.95
read_fileFunction · 0.85
addCleanupMethod · 0.80
create_fileFunction · 0.70
openFunction · 0.50
unlinkMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected