stage: tests: migrate to dir helpers

This commit is contained in:
pawel
2020-01-10 14:44:29 +01:00
parent 90152ea8b8
commit b6edeb4914
+6 -6
View File
@@ -154,18 +154,18 @@ class TestExternalRemoteResolution(TestDvc):
assert os.path.exists("movie.txt")
def test_md5_ignores_comments(repo_dir, dvc_repo):
stage, = dvc_repo.add("foo")
def test_md5_ignores_comments(tmp_dir, dvc):
stage, = tmp_dir.dvc_gen("foo", "foo content")
with open(stage.path, "a") as f:
f.write("# End comment\n")
new_stage = Stage.load(dvc_repo, stage.path)
new_stage = Stage.load(dvc, stage.path)
assert not new_stage.changed_md5()
def test_meta_is_preserved(dvc_repo):
stage, = dvc_repo.add("foo")
def test_meta_is_preserved(tmp_dir, dvc):
stage, = tmp_dir.dvc_gen("foo", "foo content")
# Add meta to DVC-file
data = load_stage_file(stage.path)
@@ -173,7 +173,7 @@ def test_meta_is_preserved(dvc_repo):
dump_stage_file(stage.path, data)
# Loading and dumping to test that it works and meta is retained
new_stage = Stage.load(dvc_repo, stage.path)
new_stage = Stage.load(dvc, stage.path)
new_stage.dump()
new_data = load_stage_file(stage.path)