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

Method test_get_url_to_dir

dvc/testing/workspace_tests.py:297–306  ·  view source on GitHub ↗
(self, cloud, tmp_dir, dname)

Source from the content-addressed store, hash-verified

295
296 @pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"])
297 def test_get_url_to_dir(self, cloud, tmp_dir, dname):
298 cloud.gen({"src": {"foo": "foo contents"}})
299 if not (cloud / "src").is_dir():
300 pytest.skip("Cannot create directories on this cloud")
301 tmp_dir.gen({"dir": {"subdir": {}}})
302
303 Repo.get_url(str(cloud / "src" / "foo"), dname, fs_config=cloud.config)
304
305 assert (tmp_dir / dname).is_dir()
306 assert (tmp_dir / dname / "foo").read_text() == "foo contents"
307
308 def test_get_url_nonexistent(self, cloud):
309 with pytest.raises(URLMissingError):

Callers

nothing calls this directly

Calls 4

is_dirMethod · 0.80
genMethod · 0.45
get_urlMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected