Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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