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

Function test_directory

tests/func/test_data_status.py:78–107  ·  view source on GitHub ↗
(tmp_dir, dvc, scm)

Source from the content-addressed store, hash-verified

76
77
78def test_directory(tmp_dir, dvc, scm):
79 tmp_dir.dvc_gen({"dir": {"foo": "foo"}}, commit="add dir")
80 tmp_dir.dvc_gen({"dir": {"foo": "foo", "bar": "bar", "foobar": "foobar"}})
81 remove(tmp_dir / "dir")
82 (tmp_dir / "dir").gen({"foo": "foo", "bar": "barr", "baz": "baz"})
83 tmp_dir.gen("untracked", "untracked")
84
85 assert dvc.data_status() == {
86 **EMPTY_STATUS,
87 "committed": {"modified": [join("dir", "")]},
88 "uncommitted": {"modified": [join("dir", "")]},
89 "git": M.dict(),
90 }
91
92 assert dvc.data_status(granular=True, untracked_files="all") == {
93 **EMPTY_STATUS,
94 "committed": {
95 "added": M.unordered(join("dir", "bar"), join("dir", "foobar")),
96 "modified": [join("dir", "")],
97 },
98 "uncommitted": {
99 "added": [join("dir", "baz")],
100 "modified": M.unordered(join("dir", ""), join("dir", "bar")),
101 "deleted": [join("dir", "foobar")],
102 },
103 "git": M.dict(),
104 "not_in_cache": [],
105 "unchanged": [join("dir", "foo")],
106 "untracked": ["untracked"],
107 }
108
109
110def test_tracked_directory_deep(tmp_dir, dvc, scm):

Callers

nothing calls this directly

Calls 4

removeFunction · 0.90
joinFunction · 0.85
dvc_genMethod · 0.80
genMethod · 0.45

Tested by

no test coverage detected