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

Function test_checkout_empty_dir

tests/func/test_checkout.py:225–238  ·  view source on GitHub ↗
(tmp_dir, dvc)

Source from the content-addressed store, hash-verified

223
224
225def test_checkout_empty_dir(tmp_dir, dvc):
226 empty_dir = tmp_dir / "empty_dir"
227 empty_dir.mkdir()
228 (stage,) = dvc.add("empty_dir")
229
230 stage.outs[0].remove()
231 assert not empty_dir.exists()
232
233 assert dvc.checkout(force=True) == empty_checkout | {
234 "added": [os.path.join("empty_dir", "")],
235 "stats": empty_stats | {"added": 0},
236 }
237 assert empty_dir.is_dir()
238 assert not list(empty_dir.iterdir())
239
240
241def test_checkout_not_cached_file(tmp_dir, dvc):

Callers

nothing calls this directly

Calls 7

mkdirMethod · 0.80
joinMethod · 0.80
is_dirMethod · 0.80
addMethod · 0.45
removeMethod · 0.45
existsMethod · 0.45
checkoutMethod · 0.45

Tested by

no test coverage detected