mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-18 15:28:28 +01:00
fixup! Make tree.walk() output deterministic
This commit is contained in:
@@ -38,9 +38,10 @@ def test_get_repo_dir(erepo):
|
||||
trees_equal(src, dst)
|
||||
|
||||
|
||||
def test_get_regular_file(repo_dir, erepo):
|
||||
src = erepo.REGULAR_FILE
|
||||
dst = erepo.REGULAR_FILE + "_imported"
|
||||
def test_get_regular_file(erepo):
|
||||
src = os.path.join(erepo.root_dir, "file")
|
||||
dst = src + "_imported"
|
||||
erepo.create(src, "hello")
|
||||
|
||||
Repo.get(erepo.root_dir, src, dst)
|
||||
|
||||
@@ -50,9 +51,11 @@ def test_get_regular_file(repo_dir, erepo):
|
||||
|
||||
|
||||
def test_get_regular_dir(repo_dir, erepo):
|
||||
src = erepo.REGULAR_DIR
|
||||
dst = erepo.REGULAR_DIR + "_imported"
|
||||
src = os.path.join(erepo.root_dir, "directory")
|
||||
dst = src + "_imported"
|
||||
|
||||
os.mkdir(src)
|
||||
erepo.create(os.path.join(src, "file"), "hello")
|
||||
Repo.get(erepo.root_dir, src, dst)
|
||||
|
||||
assert os.path.exists(dst)
|
||||
|
||||
@@ -115,7 +115,7 @@ class TestWalkInNoSCM(AssertWalkEqualMixin, TestDir):
|
||||
[
|
||||
(
|
||||
self._root_dir,
|
||||
["lib", "data_dir"],
|
||||
["data_dir"],
|
||||
["code.py", "bar", "тест", "foo"],
|
||||
),
|
||||
(join(self._root_dir, "data_dir"), ["data_sub_dir"], ["data"]),
|
||||
@@ -124,7 +124,6 @@ class TestWalkInNoSCM(AssertWalkEqualMixin, TestDir):
|
||||
[],
|
||||
["data_sub"],
|
||||
),
|
||||
(join(self._root_dir, "lib"), [], ["file.txt"]),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -152,7 +151,7 @@ class TestWalkInGit(AssertWalkEqualMixin, TestGit):
|
||||
[
|
||||
(
|
||||
self._root_dir,
|
||||
["lib", "data_dir"],
|
||||
["data_dir"],
|
||||
["bar", "тест", "code.py", "foo"],
|
||||
),
|
||||
(join(self._root_dir, "data_dir"), ["data_sub_dir"], ["data"]),
|
||||
@@ -161,7 +160,6 @@ class TestWalkInGit(AssertWalkEqualMixin, TestGit):
|
||||
[],
|
||||
["data_sub"],
|
||||
),
|
||||
(join(self._root_dir, "lib"), [], ["file.txt"]),
|
||||
],
|
||||
)
|
||||
self.assertWalkEqual(
|
||||
@@ -183,14 +181,13 @@ class TestWalkInGit(AssertWalkEqualMixin, TestGit):
|
||||
self.assertWalkEqual(
|
||||
tree.walk("."),
|
||||
[
|
||||
(self._root_dir, ["data_dir", "lib"], ["code.py"]),
|
||||
(self._root_dir, ["data_dir"], ["code.py"]),
|
||||
(join(self._root_dir, "data_dir"), ["data_sub_dir"], []),
|
||||
(
|
||||
join(self._root_dir, "data_dir", "data_sub_dir"),
|
||||
[],
|
||||
["data_sub"],
|
||||
),
|
||||
(join(self._root_dir, "lib"), [], ["file.txt"]),
|
||||
],
|
||||
)
|
||||
self.assertWalkEqual(
|
||||
|
||||
Reference in New Issue
Block a user