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

Function test_commit_with_deps

tests/func/test_commit.py:89–104  ·  view source on GitHub ↗
(tmp_dir, dvc, run_copy)

Source from the content-addressed store, hash-verified

87
88
89def test_commit_with_deps(tmp_dir, dvc, run_copy):
90 tmp_dir.gen("foo", "foo")
91 (foo_stage,) = dvc.add("foo", no_commit=True)
92 assert foo_stage is not None
93 assert len(foo_stage.outs) == 1
94
95 stage = run_copy("foo", "file", no_commit=True, name="copy")
96 assert stage is not None
97 assert len(stage.outs) == 1
98
99 assert foo_stage.outs[0].changed_cache()
100 assert stage.outs[0].changed_cache()
101
102 dvc.commit(stage.path, with_deps=True)
103 assert not foo_stage.outs[0].changed_cache()
104 assert not stage.outs[0].changed_cache()
105
106
107def test_commit_changed_md5(tmp_dir, dvc):

Callers

nothing calls this directly

Calls 5

run_copyFunction · 0.85
changed_cacheMethod · 0.80
genMethod · 0.45
addMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected