Skip to content

Commit

Permalink
Merge pull request #3099 from pared/2896_stage
Browse files Browse the repository at this point in the history
stage: tests: migrate to dir helpers
  • Loading branch information
efiop authored Jan 11, 2020
2 parents 5b85db3 + b6edeb4 commit 7f9bbd9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/func/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,26 @@ def test_remote_dependency(self):
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)
data["meta"] = {"custom_key": 42}
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)
Expand Down

0 comments on commit 7f9bbd9

Please sign in to comment.