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

Method test_copy_stat_dir

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

Source from the content-addressed store, hash-verified

1487 assert (dst.mtime() - src.mtime()) < ATIME_RESOLUTION
1488
1489 def test_copy_stat_dir(self, tmpdir):
1490 test_files = ["a", "b", "c"]
1491 src = tmpdir.join("src")
1492 for f in test_files:
1493 src.join(f).write_text(f, ensure=True, encoding="utf-8")
1494 dst = tmpdir.join("dst")
1495 # a small delay before the copy
1496 time.sleep(ATIME_RESOLUTION)
1497 src.copy(dst, stat=True)
1498 for f in test_files:
1499 oldstat = src.join(f).stat()
1500 newstat = dst.join(f).stat()
1501 assert (newstat.atime - oldstat.atime) < ATIME_RESOLUTION
1502 assert (newstat.mtime - oldstat.mtime) < ATIME_RESOLUTION
1503 assert oldstat.mode == newstat.mode
1504
1505 def test_chown_identity(self, path1):
1506 owner = path1.stat().owner

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
write_textMethod · 0.80
sleepMethod · 0.80
copyMethod · 0.80
statMethod · 0.80

Tested by

no test coverage detected