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

Function test_import_to_dir

tests/func/test_import.py:369–381  ·  view source on GitHub ↗
(dname, tmp_dir, dvc, erepo_dir)

Source from the content-addressed store, hash-verified

367
368@pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"])
369def test_import_to_dir(dname, tmp_dir, dvc, erepo_dir):
370 os.makedirs(dname, exist_ok=True)
371
372 with erepo_dir.chdir():
373 erepo_dir.dvc_gen("foo", "foo content", commit="create foo")
374
375 stage = dvc.imp(os.fspath(erepo_dir), "foo", dname)
376
377 dst = os.path.join(dname, "foo")
378
379 assert stage.outs[0].fspath == os.path.abspath(dst)
380 assert os.path.isdir(dname)
381 assert (tmp_dir / dst).read_text() == "foo content"
382
383
384def test_pull_non_workspace(tmp_dir, scm, dvc, erepo_dir):

Callers

nothing calls this directly

Calls 7

dvc_genMethod · 0.80
joinMethod · 0.80
abspathMethod · 0.80
isdirMethod · 0.80
chdirMethod · 0.45
fspathMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected