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

Method test_get_dir

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

Source from the content-addressed store, hash-verified

283 assert (tmp_dir / "foo_imported").read_text() == "foo contents"
284
285 def test_get_dir(self, cloud, tmp_dir):
286 cloud.gen({"foo": {"foo": "foo contents"}})
287 if not (cloud / "foo").is_dir():
288 pytest.skip("Cannot create directories on this cloud")
289
290 Repo.get_url(str(cloud / "foo"), "foo_imported", fs_config=cloud.config)
291
292 assert (tmp_dir / "foo_imported").is_dir()
293 assert (tmp_dir / "foo_imported" / "foo").is_file()
294 assert (tmp_dir / "foo_imported" / "foo").read_text() == "foo contents"
295
296 @pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"])
297 def test_get_url_to_dir(self, cloud, tmp_dir, dname):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected