Skip to content

Commit

Permalink
tests/diff: add directory to no_cache_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr. Outis committed Jan 27, 2020
1 parent 27ada02 commit e6a957a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tests/func/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,29 @@ def test_added(tmp_dir, scm, dvc):


def test_no_cache_entry(tmp_dir, scm, dvc):
tmp_dir.dvc_gen("file", "text")
tmp_dir.dvc_gen("file", "first", commit="add a file")

tmp_dir.dvc_gen({"dir": {"1": "1", "2": "2"}})
tmp_dir.dvc_gen("file", "second")

shutil.rmtree(fspath(tmp_dir / ".dvc" / "cache"))
(tmp_dir / ".dvc" / "state").unlink()

dir_checksum = "5fb6b29836c388e093ca0715c872fe2a.dir"

assert dvc.diff() == {
"added": [{"filename": "file", "checksum": digest("text")}],
"added": [
{"filename": "dir/", "checksum": dir_checksum},
{"filename": "dir/1", "checksum": digest("1")},
{"filename": "dir/2", "checksum": digest("2")},
],
"deleted": [],
"modified": [],
"modified": [
{
"filename": "file",
"checksum": {"old": digest("first"), "new": digest("second")},
}
],
}


Expand Down

0 comments on commit e6a957a

Please sign in to comment.