(tmp_dir, scm, dvc, make_tmp_dir)
| 129 | |
| 130 | |
| 131 | def test_cmd_cache_relative_path(tmp_dir, scm, dvc, make_tmp_dir): |
| 132 | cache_dir = make_tmp_dir("cache") |
| 133 | dname = relpath(cache_dir) |
| 134 | ret = main(["cache", "dir", dname]) |
| 135 | assert ret == 0 |
| 136 | |
| 137 | dvc.config.load() |
| 138 | dvc.cache = CacheManager(dvc) |
| 139 | |
| 140 | # NOTE: we are in the repo's root and config is in .dvc/, so |
| 141 | # dir path written to config should be just one level above. |
| 142 | rel = os.path.join("..", dname) |
| 143 | config = configobj.ConfigObj(dvc.config.files["repo"]) |
| 144 | assert config["cache"]["dir"] == rel.replace("\\", "/") |
| 145 | |
| 146 | tmp_dir.dvc_gen({"foo": "foo"}) |
| 147 | |
| 148 | assert os.path.exists( |
| 149 | os.path.join(cache_dir, "files", "md5", "ac", "bd18db4cc2f85cedef654fccc4a4d8") |
| 150 | ) |
| 151 | |
| 152 | |
| 153 | def test_default_cache_type(dvc): |
nothing calls this directly
no test coverage detected