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

Method test_dir

dvc/testing/workspace_tests.py:208–221  ·  view source on GitHub ↗
(self, cloud)

Source from the content-addressed store, hash-verified

206 match_files(fs, result, [{"path": fs.join(fs_path, fname), "isdir": False}])
207
208 def test_dir(self, cloud):
209 cloud.gen({"dir/foo": "foo contents", "dir/subdir/bar": "bar contents"})
210 if not (cloud / "dir").is_dir():
211 pytest.skip("Cannot create directories on this cloud")
212 fs, _ = parse_external_url(cloud.url, cloud.config)
213 result = ls_url(str(cloud / "dir"), fs_config=cloud.config)
214 match_files(
215 fs,
216 result,
217 [
218 {"path": "foo", "isdir": False},
219 {"path": "subdir", "isdir": True},
220 ],
221 )
222
223 def test_recursive(self, cloud):
224 cloud.gen({"dir/foo": "foo contents", "dir/subdir/bar": "bar contents"})

Callers

nothing calls this directly

Calls 5

ls_urlFunction · 0.90
parse_external_urlFunction · 0.85
is_dirMethod · 0.80
match_filesFunction · 0.70
genMethod · 0.45

Tested by

no test coverage detected