MCPcopy
hub / github.com/pytest-dev/pytest / test_copy_stat_file

Method test_copy_stat_file

testing/_py/test_local.py:1477–1487  ·  view source on GitHub ↗
(self, tmpdir)

Source from the content-addressed store, hash-verified

1475 assert b.join(f.basename).stat().mode == newmode
1476
1477 def test_copy_stat_file(self, tmpdir):
1478 src = tmpdir.ensure("src")
1479 dst = tmpdir.join("dst")
1480 # a small delay before the copy
1481 time.sleep(ATIME_RESOLUTION)
1482 src.copy(dst, stat=True)
1483 oldstat = src.stat()
1484 newstat = dst.stat()
1485 assert oldstat.mode == newstat.mode
1486 assert (dst.atime() - src.atime()) < ATIME_RESOLUTION
1487 assert (dst.mtime() - src.mtime()) < ATIME_RESOLUTION
1488
1489 def test_copy_stat_dir(self, tmpdir):
1490 test_files = ["a", "b", "c"]

Callers

nothing calls this directly

Calls 7

ensureMethod · 0.80
joinMethod · 0.80
sleepMethod · 0.80
copyMethod · 0.80
statMethod · 0.80
atimeMethod · 0.80
mtimeMethod · 0.45

Tested by

no test coverage detected