MCPcopy
hub / github.com/treeverse/dvc / test_commit_changed_md5

Function test_commit_changed_md5

tests/func/test_commit.py:107–119  ·  view source on GitHub ↗
(tmp_dir, dvc)

Source from the content-addressed store, hash-verified

105
106
107def test_commit_changed_md5(tmp_dir, dvc):
108 tmp_dir.gen({"file": "file content"})
109 (stage,) = dvc.add("file", no_commit=True)
110
111 stage_file_content = (tmp_dir / stage.path).parse()
112 stage_file_content["md5"] = "1111111111"
113 (tmp_dir / stage.path).dump(stage_file_content)
114
115 with pytest.raises(StageCommitError):
116 dvc.commit(stage.path)
117
118 dvc.commit(stage.path, force=True)
119 assert "md5" not in (tmp_dir / stage.path).parse()
120
121
122def test_commit_no_exec(tmp_dir, dvc):

Callers

nothing calls this directly

Calls 5

parseMethod · 0.80
genMethod · 0.45
addMethod · 0.45
dumpMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected