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

Function test_target_remote

tests/func/test_data_cloud.py:622–654  ·  view source on GitHub ↗
(tmp_dir, dvc, make_remote)

Source from the content-addressed store, hash-verified

620
621
622def test_target_remote(tmp_dir, dvc, make_remote):
623 make_remote("default", default=True)
624 make_remote("myremote", default=False)
625
626 tmp_dir.dvc_gen("foo", "foo")
627 tmp_dir.dvc_gen("data", {"one": "one", "two": "two"})
628
629 dvc.push(remote="myremote")
630
631 default = dvc.cloud.get_remote_odb("default")
632 myremote = dvc.cloud.get_remote_odb("myremote")
633
634 assert set(default.all()) == set()
635 assert set(myremote.all()) == {
636 "acbd18db4cc2f85cedef654fccc4a4d8",
637 "f97c5d29941bfb1b2fdab0874906ab82",
638 "6b18131dc289fd37006705affe961ef8.dir",
639 "b8a9f715dbb64fd5c56e7783c6820a61",
640 }
641
642 clean(["foo", "data"], dvc)
643
644 assert dvc.pull(remote="myremote") == empty_pull | {
645 "added": ["data" + os.sep, "foo"],
646 "stats": empty_stats | {"fetched": 4, "added": 3},
647 }
648
649 assert set(dvc.cache.local.all()) == {
650 "acbd18db4cc2f85cedef654fccc4a4d8",
651 "f97c5d29941bfb1b2fdab0874906ab82",
652 "6b18131dc289fd37006705affe961ef8.dir",
653 "b8a9f715dbb64fd5c56e7783c6820a61",
654 }
655
656
657def test_output_target_remote(tmp_dir, dvc, make_remote):

Callers

nothing calls this directly

Calls 6

make_remoteFunction · 0.85
dvc_genMethod · 0.80
get_remote_odbMethod · 0.80
cleanFunction · 0.70
pushMethod · 0.45
pullMethod · 0.45

Tested by

no test coverage detected