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

Function test_checkout_cli

tests/func/test_checkout.py:47–68  ·  view source on GitHub ↗
(tmp_dir, dvc, copy_script)

Source from the content-addressed store, hash-verified

45
46
47def test_checkout_cli(tmp_dir, dvc, copy_script):
48 tmp_dir.dvc_gen({"foo": "foo", "data": {"file": "file"}})
49 dvc.run(
50 outs=["file1"],
51 deps=["foo", "copy.py"],
52 cmd="python copy.py foo file1",
53 name="copy-foo-file1",
54 )
55 remove(tmp_dir / "foo")
56 remove("data")
57
58 assert main(["checkout", "--force"]) == 0
59 assert (tmp_dir / "foo").read_text() == "foo"
60 assert (tmp_dir / "data").read_text() == {"file": "file"}
61
62 remove(tmp_dir / "foo")
63 remove("data")
64
65 assert main(["checkout", "--force", "foo.dvc"]) == 0
66 assert main(["checkout", "--force", "data.dvc"]) == 0
67 assert (tmp_dir / "foo").read_text() == "foo"
68 assert (tmp_dir / "data").read_text() == {"file": "file"}
69
70
71@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

removeFunction · 0.90
mainFunction · 0.90
dvc_genMethod · 0.80
runMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected