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

Function test_move

tests/func/test_move.py:12–22  ·  view source on GitHub ↗
(tmp_dir, dvc, scm)

Source from the content-addressed store, hash-verified

10
11
12def test_move(tmp_dir, dvc, scm):
13 tmp_dir.dvc_gen("foo", "bar")
14 assert (tmp_dir / "foo.dvc").exists()
15 dvc.move("foo", "bar")
16
17 assert not (tmp_dir / "foo.dvc").exists()
18 assert (tmp_dir / "bar.dvc").exists()
19 assert not (tmp_dir / "foo").is_file()
20 assert (tmp_dir / "bar").is_file()
21 # should only have the new path in the .gitignore, and only once
22 assert (tmp_dir / ".gitignore").read_text().splitlines() == ["/bar"]
23
24
25def test_move_non_existent_file(dvc):

Callers

nothing calls this directly

Calls 5

dvc_genMethod · 0.80
moveMethod · 0.80
is_fileMethod · 0.80
existsMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected