mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
repo: rename odb -> cache
We used to have it named `cache` before, but these days it is clear that you can have three odbs: just odb (e.g. in-memory), cache (typically local) or remote (typically cloud). Fixing naming here before proceeding with introducing `out.odb` and `out.cache`. In preparation for migration to https://github.com/iterative/dvc-data/pull/304
This commit is contained in:
@@ -32,7 +32,7 @@ def test_status_download_optimization(mocker, dvc):
|
||||
|
||||
@pytest.mark.parametrize("link_name", ["hardlink", "symlink"])
|
||||
def test_is_protected(tmp_dir, dvc, link_name):
|
||||
odb = dvc.odb.local
|
||||
odb = dvc.cache.local
|
||||
fs = odb.fs
|
||||
link_method = getattr(fs, link_name)
|
||||
|
||||
@@ -67,7 +67,7 @@ def test_protect_ignore_errors(tmp_dir, dvc, mocker, err):
|
||||
tmp_dir.gen("foo", "foo")
|
||||
|
||||
mock_chmod = mocker.patch("os.chmod", side_effect=OSError(err, "something"))
|
||||
dvc.odb.local.protect("foo")
|
||||
dvc.cache.local.protect("foo")
|
||||
assert mock_chmod.called
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ def test_set_exec_ignore_errors(tmp_dir, dvc, mocker, err):
|
||||
tmp_dir.gen("foo", "foo")
|
||||
|
||||
mock_chmod = mocker.patch("os.chmod", side_effect=OSError(err, "something"))
|
||||
dvc.odb.local.set_exec("foo")
|
||||
dvc.cache.local.set_exec("foo")
|
||||
assert mock_chmod.called
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ def test_staging_file(tmp_dir, dvc):
|
||||
tmp_dir.gen("foo", "foo")
|
||||
fs = LocalFileSystem()
|
||||
|
||||
local_odb = dvc.odb.local
|
||||
local_odb = dvc.cache.local
|
||||
staging_odb, _, obj = build(local_odb, (tmp_dir / "foo").fs_path, fs, "md5")
|
||||
|
||||
assert not local_odb.exists(obj.hash_info.value)
|
||||
@@ -113,7 +113,7 @@ def test_staging_dir(tmp_dir, dvc):
|
||||
|
||||
tmp_dir.gen({"dir": {"foo": "foo", "bar": "bar"}})
|
||||
fs = LocalFileSystem()
|
||||
local_odb = dvc.odb.local
|
||||
local_odb = dvc.cache.local
|
||||
|
||||
staging_odb, _, obj = build(local_odb, (tmp_dir / "dir").fs_path, fs, "md5")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user