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

Method test_import_empty_dir

dvc/testing/workspace_tests.py:71–86  ·  view source on GitHub ↗
(self, tmp_dir, dvc, workspace, is_object_storage)

Source from the content-addressed store, hash-verified

69 pytest.skip()
70
71 def test_import_empty_dir(self, tmp_dir, dvc, workspace, is_object_storage):
72 # prefix based storage services (e.g s3) doesn't have the real concept
73 # of directories. So instead we create an empty file that ends with a
74 # trailing slash in order to actually support this operation
75 if is_object_storage:
76 contents: Union[str, dict[str, str]] = ""
77 else:
78 contents = {}
79
80 workspace.gen({"empty_dir/": contents})
81
82 dvc.imp_url("remote://workspace/empty_dir/")
83
84 empty_dir = tmp_dir / "empty_dir"
85 assert empty_dir.is_dir()
86 assert tuple(empty_dir.iterdir()) == ()
87
88
89class TestImportURLVersionAware:

Callers

nothing calls this directly

Calls 2

is_dirMethod · 0.80
genMethod · 0.45

Tested by

no test coverage detected