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

Method test_empty_file

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

Source from the content-addressed store, hash-verified

3230 self.assertEqual(cm.exception.filename, name)
3231
3232 def test_empty_file(self):
3233 srcname = TESTFN + 'src'
3234 dstname = TESTFN + 'dst'
3235 self.addCleanup(lambda: os_helper.unlink(srcname))
3236 self.addCleanup(lambda: os_helper.unlink(dstname))
3237 create_file(srcname)
3238
3239 with open(srcname, "rb") as src:
3240 with open(dstname, "wb") as dst:
3241 self.zerocopy_fun(src, dst)
3242
3243 self.assertEqual(read_file(dstname, binary=True), b"")
3244
3245 def test_unhandled_exception(self):
3246 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