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

Function test_copy_paths

tests/func/experiments/test_experiments.py:728–744  ·  view source on GitHub ↗
(tmp_dir, scm, dvc, tmp)

Source from the content-addressed store, hash-verified

726
727@pytest.mark.parametrize("tmp", [True, False])
728def test_copy_paths(tmp_dir, scm, dvc, tmp):
729 stage = dvc.stage.add(cmd="cat file && ls dir", name="foo")
730 scm.add_commit(["dvc.yaml"], message="add dvc.yaml")
731
732 (tmp_dir / "dir").mkdir()
733 (tmp_dir / "dir" / "file").write_text("dir/file")
734 scm.ignore(tmp_dir / "dir")
735 (tmp_dir / "file").write_text("file")
736 scm.ignore(tmp_dir / "file")
737
738 results = dvc.experiments.run(
739 stage.addressing, tmp_dir=tmp, copy_paths=["dir", "file"]
740 )
741 exp = first(results)
742 fs = scm.get_fs(exp)
743 assert not fs.exists("dir")
744 assert not fs.exists("file")
745
746
747def test_copy_paths_errors(tmp_dir, scm, dvc, mocker):

Callers

nothing calls this directly

Calls 6

mkdirMethod · 0.80
write_textMethod · 0.80
addMethod · 0.45
ignoreMethod · 0.45
runMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected