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

Method test_samestat

Lib/test/test_genericpath.py:275–289  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

273 self.skipTest('os.link(): %s' % e)
274
275 def test_samestat(self):
276 test_fn1 = os_helper.TESTFN
277 test_fn2 = os_helper.TESTFN + "2"
278 self.addCleanup(os_helper.unlink, test_fn1)
279 self.addCleanup(os_helper.unlink, test_fn2)
280
281 create_file(test_fn1)
282 stat1 = os.stat(test_fn1)
283 self.assertTrue(self.pathmodule.samestat(stat1, os.stat(test_fn1)))
284
285 create_file(test_fn2)
286 stat2 = os.stat(test_fn2)
287 self.assertFalse(self.pathmodule.samestat(stat1, stat2))
288
289 self.assertRaises(TypeError, self.pathmodule.samestat)
290
291 def _test_samestat_on_link_func(self, func):
292 test_fn1 = os_helper.TESTFN + "1"

Callers

nothing calls this directly

Calls 6

addCleanupMethod · 0.80
assertTrueMethod · 0.80
assertFalseMethod · 0.80
create_fileFunction · 0.70
statMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected