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

Function test_diff_dirty

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

Source from the content-addressed store, hash-verified

331
332
333def test_diff_dirty(tmp_dir, scm, dvc):
334 tmp_dir.dvc_gen(
335 {"file": "file_content", "dir": {"dir_file1": "dir file content"}},
336 commit="initial",
337 )
338
339 (tmp_dir / "file").unlink()
340 tmp_dir.gen({"dir": {"dir_file2": "dir file 2 content"}})
341 tmp_dir.dvc_gen("new_file", "new_file_content")
342
343 result = dvc.diff()
344
345 assert result == {
346 "added": [
347 {
348 "hash": digest("dir file 2 content"),
349 "path": os.path.join("dir", "dir_file2"),
350 },
351 {"hash": "86d049de17c76ac44cdcac146042ec9b", "path": "new_file"},
352 ],
353 "deleted": [{"hash": "7f0b6bb0b7e951b7fd2b2a4a326297e1", "path": "file"}],
354 "modified": [
355 {
356 "hash": {
357 "new": "38175ad60f0e58ac94e0e2b7688afd81.dir",
358 "old": "92daf39af116ca2fb245acaeb2ae65f7.dir",
359 },
360 "path": os.path.join("dir", ""),
361 }
362 ],
363 "not in cache": [],
364 "renamed": [],
365 }
366
367
368def test_no_changes(tmp_dir, scm, dvc):

Callers

nothing calls this directly

Calls 6

digestFunction · 0.85
dvc_genMethod · 0.80
unlinkMethod · 0.80
joinMethod · 0.80
genMethod · 0.45
diffMethod · 0.45

Tested by

no test coverage detected