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

Function test_external_cache_dir

tests/func/test_odb.py:53–73  ·  view source on GitHub ↗
(tmp_dir, dvc, make_tmp_dir)

Source from the content-addressed store, hash-verified

51
52
53def test_external_cache_dir(tmp_dir, dvc, make_tmp_dir):
54 cache_dir = make_tmp_dir("cache")
55
56 with dvc.config.edit() as conf:
57 conf["cache"]["dir"] = cache_dir.fs_path
58 assert not os.path.exists(dvc.cache.local.path)
59 dvc.cache = CacheManager(dvc)
60
61 tmp_dir.dvc_gen({"foo": "foo"})
62
63 tmp_dir.dvc_gen(
64 {
65 "data_dir": {
66 "data": "data_dir/data",
67 "data_sub_dir": {"data_sub": "data_dir/data_sub_dir/data_sub"},
68 }
69 }
70 )
71
72 assert not os.path.exists(".dvc/cache")
73 assert len(os.listdir(cache_dir)) != 0
74
75
76def test_shared_cache_dir(tmp_dir):

Callers

nothing calls this directly

Calls 5

CacheManagerClass · 0.90
make_tmp_dirFunction · 0.85
editMethod · 0.80
dvc_genMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected