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

Function test_pull_external_dvc_imports_mixed

tests/func/test_data_cloud.py:322–341  ·  view source on GitHub ↗
(tmp_dir, dvc, scm, erepo_dir, local_remote)

Source from the content-addressed store, hash-verified

320
321
322def test_pull_external_dvc_imports_mixed(tmp_dir, dvc, scm, erepo_dir, local_remote):
323 with erepo_dir.chdir():
324 erepo_dir.dvc_gen("foo", "foo", commit="first")
325 os.remove("foo")
326
327 # imported: foo
328 dvc.imp(os.fspath(erepo_dir), "foo")
329
330 # local-object: bar
331 tmp_dir.dvc_gen("bar", "bar")
332 dvc.push("bar")
333
334 clean(["foo", "bar"], dvc)
335
336 assert dvc.pull() == empty_pull | {
337 "added": ["bar", "foo"],
338 "stats": empty_stats | {"fetched": 2, "added": 2},
339 }
340 assert (tmp_dir / "foo").read_text() == "foo"
341 assert (tmp_dir / "bar").read_text() == "bar"
342
343
344def clean(outs, dvc=None):

Callers

nothing calls this directly

Calls 8

dvc_genMethod · 0.80
cleanFunction · 0.70
chdirMethod · 0.45
removeMethod · 0.45
fspathMethod · 0.45
pushMethod · 0.45
pullMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected