Add sleep 1s before create link again

This commit is contained in:
xzg 2017-12-06 22:09:22 +08:00
parent 927ff3aae4
commit 7bedbd9f36
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import os
import pytest
import time
from pydu.platform import WINDOWS
from pydu.file import makedirs, remove, removes, open_file, copy, touch, symlink
@ -168,6 +169,7 @@ class TestLink:
touch(f)
link(f, link_f)
t1 = os.path.getctime(link_f)
time.sleep(1)
link(f, link_f, overwrite=True)
t2 = os.path.getctime(link_f)
assert t1 != t2
@ -195,6 +197,7 @@ class TestSymLink:
touch(f)
symlink(f, link_f)
t1 = os.path.getctime(link_f)
time.sleep(1)
symlink(f, link_f, overwrite=True)
t2 = os.path.getctime(link_f)
assert t1 != t2