checkout: raise on non existing dir cache (#2514)

* checkout: raise on non existing dir cache

* checkout: don't throw on failed load_dir_cache

* checkout: raise on failed checkouts, only after all checkouts are perfromed

* remote: base: raise on failed dir cache loading

* rename exception for failed checkout
This commit is contained in:
Paweł Redzyński
2019-09-24 16:31:36 +03:00
committed by Ruslan Kuprieiev
parent 7409fadb84
commit be012e70cf
7 changed files with 58 additions and 18 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ import configobj
from dvc.cache import Cache
from dvc.main import main
from dvc.remote.base import DirCacheError
from dvc.utils import relpath
from tests.basic_env import TestDvc, TestDir
@@ -49,7 +50,8 @@ class TestCacheLoadBadDirCache(TestDvc):
checksum = "123.dir"
fname = self.dvc.cache.local.get(checksum)
self.create(fname, "<clearly>not,json")
self._do_test(self.dvc.cache.local.load_dir_cache(checksum))
with pytest.raises(DirCacheError):
self.dvc.cache.local.load_dir_cache(checksum)
checksum = "234.dir"
fname = self.dvc.cache.local.get(checksum)