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

Function test_import_url_to_dir

tests/func/test_import_url.py:68–80  ·  view source on GitHub ↗
(dname, tmp_dir, dvc)

Source from the content-addressed store, hash-verified

66
67@pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"])
68def test_import_url_to_dir(dname, tmp_dir, dvc):
69 tmp_dir.gen({"data_dir": {"file": "file content"}})
70 src = os.path.join("data_dir", "file")
71
72 os.makedirs(dname, exist_ok=True)
73
74 stage = dvc.imp_url(src, dname)
75
76 dst = tmp_dir / dname / "file"
77
78 assert stage.outs[0].fs_path == os.fspath(dst)
79 assert os.path.isdir(dname)
80 assert dst.read_text() == "file content"
81
82
83def test_import_stage_accompanies_target(tmp_dir, dvc, erepo_dir):

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
isdirMethod · 0.80
genMethod · 0.45
fspathMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected