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

Method _test_samestat_on_link_func

Lib/test/test_genericpath.py:291–305  ·  view source on GitHub ↗
(self, func)

Source from the content-addressed store, hash-verified

289 self.assertRaises(TypeError, self.pathmodule.samestat)
290
291 def _test_samestat_on_link_func(self, func):
292 test_fn1 = os_helper.TESTFN + "1"
293 test_fn2 = os_helper.TESTFN + "2"
294 self.addCleanup(os_helper.unlink, test_fn1)
295 self.addCleanup(os_helper.unlink, test_fn2)
296
297 create_file(test_fn1)
298 func(test_fn1, test_fn2)
299 self.assertTrue(self.pathmodule.samestat(os.stat(test_fn1),
300 os.stat(test_fn2)))
301 os.remove(test_fn2)
302
303 create_file(test_fn2)
304 self.assertFalse(self.pathmodule.samestat(os.stat(test_fn1),
305 os.stat(test_fn2)))
306
307 @os_helper.skip_unless_symlink
308 def test_samestat_on_symlink(self):

Callers 2

test_samestat_on_linkMethod · 0.95

Calls 7

addCleanupMethod · 0.80
assertTrueMethod · 0.80
assertFalseMethod · 0.80
create_fileFunction · 0.70
funcFunction · 0.70
statMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected