| 63 | |
| 64 | |
| 65 | def 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 | |
| 98 | def test_diff_no_cache(tmp_dir, scm, dvc): |