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

Method _test_samefile_on_link_func

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

Source from the content-addressed store, hash-verified

241 self.assertRaises(TypeError, self.pathmodule.samefile)
242
243 def _test_samefile_on_link_func(self, func):
244 test_fn1 = os_helper.TESTFN
245 test_fn2 = os_helper.TESTFN + "2"
246 self.addCleanup(os_helper.unlink, test_fn1)
247 self.addCleanup(os_helper.unlink, test_fn2)
248
249 create_file(test_fn1)
250
251 func(test_fn1, test_fn2)
252 self.assertTrue(self.pathmodule.samefile(test_fn1, test_fn2))
253 os.remove(test_fn2)
254
255 create_file(test_fn2)
256 self.assertFalse(self.pathmodule.samefile(test_fn1, test_fn2))
257
258 @os_helper.skip_unless_symlink
259 def test_samefile_on_symlink(self):

Callers 2

test_samefile_on_linkMethod · 0.95

Calls 7

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

Tested by

no test coverage detected