(tmp_dir, dvc, make_tmp_dir)
| 51 | |
| 52 | |
| 53 | def 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 | |
| 76 | def test_shared_cache_dir(tmp_dir): |
nothing calls this directly
no test coverage detected