MCPcopy Index your code
hub / github.com/treeverse/dvc / test_no_cache_entry

Function test_no_cache_entry

tests/func/test_diff.py:65–95  ·  view source on GitHub ↗
(tmp_dir, scm, dvc)

Source from the content-addressed store, hash-verified

63
64
65def test_no_cache_entry(tmp_dir, scm, dvc):
66 tmp_dir.dvc_gen("file", "first", commit="add a file")
67
68 tmp_dir.dvc_gen({"dir": {"1": "1", "2": "2"}})
69 tmp_dir.dvc_gen("file", "second")
70
71 remove(tmp_dir / ".dvc" / "cache")
72
73 dir_checksum = "5fb6b29836c388e093ca0715c872fe2a.dir"
74
75 assert dvc.diff() == {
76 "added": [
77 {"path": os.path.join("dir", ""), "hash": dir_checksum},
78 {"path": os.path.join("dir", "1"), "hash": digest("1")},
79 {"path": os.path.join("dir", "2"), "hash": digest("2")},
80 ],
81 "deleted": [],
82 "modified": [
83 {
84 "path": "file",
85 "hash": {"old": digest("first"), "new": digest("second")},
86 }
87 ],
88 "not in cache": [
89 {
90 "path": "file",
91 "hash": digest("first"),
92 }
93 ],
94 "renamed": [],
95 }
96
97
98def test_diff_no_cache(tmp_dir, scm, dvc):

Callers

nothing calls this directly

Calls 5

removeFunction · 0.90
digestFunction · 0.85
dvc_genMethod · 0.80
joinMethod · 0.80
diffMethod · 0.45

Tested by

no test coverage detected