odb: use odb.path instead of odb.cache_dir

This commit is contained in:
Ruslan Kuprieiev
2022-08-03 21:10:28 +03:00
parent ecd98bdf7d
commit fcc7240617
31 changed files with 80 additions and 84 deletions
+5 -5
View File
@@ -48,7 +48,7 @@ def test_open_external(tmp_dir, erepo_dir, cloud):
erepo_dir.dvc.push(all_branches=True)
# Remove cache to force download
remove(erepo_dir.dvc.odb.local.cache_dir)
remove(erepo_dir.dvc.odb.local.path)
# Using file url to force clone to tmp repo
repo_url = f"file://{erepo_dir.as_posix()}"
@@ -63,7 +63,7 @@ def test_open_granular(tmp_dir, dvc, remote):
dvc.push()
# Remove cache to force download
remove(dvc.odb.local.cache_dir)
remove(dvc.odb.local.path)
with api.open("dir/foo") as fd:
assert fd.read() == "foo-text"
@@ -73,7 +73,7 @@ def test_missing(tmp_dir, dvc, remote):
tmp_dir.dvc_gen("foo", "foo")
# Remove cache to make foo missing
remove(dvc.odb.local.cache_dir)
remove(dvc.odb.local.path)
api.read("foo")
@@ -135,7 +135,7 @@ def test_api_missing_local_cache_exists_on_remote(
dvc.push()
# Remove cache to make foo missing
remove(dvc.odb.local.cache_dir)
remove(dvc.odb.local.path)
remove(first(files))
repo_url = f"file://{tmp_dir.as_posix()}" if as_external else None
@@ -220,7 +220,7 @@ def test_open_from_remote(tmp_dir, erepo_dir, cloud, local_cloud):
erepo_dir.add_remote(config=local_cloud.config, default=True)
erepo_dir.dvc_gen({"dir": {"foo": "foo content"}}, commit="create file")
erepo_dir.dvc.push(remote="other")
remove(erepo_dir.dvc.odb.local.cache_dir)
remove(erepo_dir.dvc.odb.local.path)
with api.open(
os.path.join("dir", "foo"),