mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 23:10:10 +01:00
cache: move unrelated helpers out of CloudCache class (#5439)
* cache: move transfer to objects Moving it as is for now. * cache: move link() to checkout
This commit is contained in:
@@ -937,8 +937,8 @@ def test_add_file_in_symlink_dir(make_tmp_dir, tmp_dir, dvc, external):
|
||||
def test_add_with_cache_link_error(tmp_dir, dvc, mocker, caplog):
|
||||
tmp_dir.gen("foo", "foo")
|
||||
|
||||
mocker.patch.object(
|
||||
dvc.cache.local, "_do_link", side_effect=DvcException("link failed")
|
||||
mocker.patch(
|
||||
"dvc.checkout._do_link", side_effect=DvcException("link failed")
|
||||
)
|
||||
with caplog.at_level(logging.WARNING, logger="dvc"):
|
||||
dvc.add("foo")
|
||||
|
||||
@@ -55,6 +55,8 @@ def test_copy_singlepart_preserve_etag():
|
||||
[S3Tree.PATH_CLS("s3://bucket/"), S3Tree.PATH_CLS("s3://bucket/ns/")],
|
||||
)
|
||||
def test_link_created_on_non_nested_path(base_info, tmp_dir, dvc, scm):
|
||||
from dvc.checkout import _link
|
||||
|
||||
tree = S3Tree(dvc, {"url": str(base_info.parent)})
|
||||
cache = CloudCache(tree)
|
||||
s3 = cache.tree.s3.meta.client
|
||||
@@ -62,7 +64,7 @@ def test_link_created_on_non_nested_path(base_info, tmp_dir, dvc, scm):
|
||||
s3.put_object(
|
||||
Bucket=base_info.bucket, Key=(base_info / "from").path, Body="data"
|
||||
)
|
||||
cache.link(base_info / "from", base_info / "to")
|
||||
_link(cache, base_info / "from", base_info / "to")
|
||||
|
||||
assert cache.tree.exists(base_info / "from")
|
||||
assert cache.tree.exists(base_info / "to")
|
||||
|
||||
Reference in New Issue
Block a user