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

Function test_targets_single_dir

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

Source from the content-addressed store, hash-verified

426
427
428def test_targets_single_dir(tmp_dir, scm, dvc):
429 setup_targets_test(tmp_dir)
430
431 dir_checksum = "5fb6b29836c388e093ca0715c872fe2a.dir"
432
433 expected_result = {
434 "added": [
435 {"path": os.path.join("dir", ""), "hash": dir_checksum},
436 {"path": os.path.join("dir", "1"), "hash": digest("1")},
437 {"path": os.path.join("dir", "2"), "hash": digest("2")},
438 ],
439 "deleted": [],
440 "modified": [],
441 "not in cache": [],
442 "renamed": [],
443 }
444
445 assert dvc.diff(targets=["dir"]) == expected_result
446 assert dvc.diff(targets=["dir" + os.path.sep]) == expected_result
447
448
449def test_targets_single_file_in_dir(tmp_dir, scm, dvc):

Callers

nothing calls this directly

Calls 4

setup_targets_testFunction · 0.85
digestFunction · 0.85
joinMethod · 0.80
diffMethod · 0.45

Tested by

no test coverage detected