Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Jun 2, 2020
1 parent 39d475d commit 71f4540
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dvc/remote/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def _verify_link(self, path_info, link_type):
if self.cache_type_confirmed:
return

is_link = getattr(self, f"is_{link_type}", None)
is_link = getattr(self.tree, f"is_{link_type}", None)
if is_link and not is_link(path_info):
self.tree.remove(path_info)
raise DvcException(f"failed to verify {link_type}")
Expand Down
2 changes: 1 addition & 1 deletion dvc/remote/oss.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def oss_service(self):
return self.remote.oss_service

def _generate_download_url(self, path_info, expires=3600):
assert path_info.bucket == self.path_info.bucket
assert path_info.bucket == self.remote.path_info.bucket

return self.oss_service.sign_url("GET", path_info.path, expires)

Expand Down
4 changes: 2 additions & 2 deletions tests/func/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from dvc.main import main
from dvc.output.base import OutputAlreadyTrackedError, OutputIsStageFileError
from dvc.remote import LocalRemote, LocalRemoteTree
from dvc.remote.local import LocalRemote, LocalRemoteTree
from dvc.repo import Repo as DvcRepo
from dvc.stage import Stage
from dvc.system import System
Expand Down Expand Up @@ -592,7 +592,7 @@ def test_should_not_checkout_when_adding_cached_copy(tmp_dir, dvc, mocker):

shutil.copy("bar", "foo")

copy_spy = mocker.spy(dvc.cache.local, "copy")
copy_spy = mocker.spy(dvc.cache.local.tree, "copy")

dvc.add("foo")

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/remote/test_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_get_file_checksum(tmp_dir):
remote = AzureRemote(None, {})
to_info = remote.path_cls(Azure.get_url())
remote.upload(PathInfo("foo"), to_info)
assert remote.exists(to_info)
assert remote.tree.exists(to_info)
checksum = remote.get_file_checksum(to_info)
assert checksum
assert isinstance(checksum, str)
Expand Down

0 comments on commit 71f4540

Please sign in to comment.