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

Function test_repro_changed_dir_data

tests/func/repro/test_repro.py:1153–1179  ·  view source on GitHub ↗
(tmp_dir, dvc, copy_script)

Source from the content-addressed store, hash-verified

1151
1152
1153def test_repro_changed_dir_data(tmp_dir, dvc, copy_script):
1154 tmp_dir.gen({"data": {"foo": "foo"}, "bar": "bar"})
1155 stage = dvc.run(
1156 outs=["dir"],
1157 deps=["data", "copy.py"],
1158 cmd="python copy.py data dir",
1159 name="copy-dir",
1160 )
1161
1162 assert not dvc.reproduce(stage.addressing)
1163
1164 with (tmp_dir / "data" / "foo").open("a", encoding="utf-8") as f:
1165 f.write("add")
1166
1167 stages = dvc.reproduce(stage.addressing)
1168 assert len(stages) == 1
1169
1170 # Check that dvc indeed registers changed output dir
1171 shutil.move("bar", "dir")
1172 stages = dvc.reproduce(stage.addressing)
1173 assert len(stages) == 1
1174
1175 file = os.path.join("data", "foo")
1176 # Check that dvc registers mtime change for the directory.
1177 system.hardlink(file, file + ".lnk")
1178 stages = dvc.reproduce(stage.addressing)
1179 assert len(stages) == 1
1180
1181
1182def test_repro_missing_lock_info(tmp_dir, dvc, copy_script):

Callers

nothing calls this directly

Calls 7

openMethod · 0.80
writeMethod · 0.80
moveMethod · 0.80
joinMethod · 0.80
genMethod · 0.45
runMethod · 0.45
reproduceMethod · 0.45

Tested by

no test coverage detected