Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/unit/remote/test_azure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import pytest

from dvc.path_info import PathInfo
from dvc.remote.azure import AzureRemote
from tests.remotes import Azure

container_name = "container-name"
connection_string = (
Expand Down Expand Up @@ -26,3 +30,17 @@ def test_init(dvc):
remote = AzureRemote(dvc, config)
assert remote.path_info == url
assert remote.connection_string == connection_string


def test_get_file_checksum(tmp_dir):
if not Azure.should_test():
pytest.skip("no azurite running")

tmp_dir.gen("foo", "foo")

remote = AzureRemote(None, {})
to_info = remote.path_cls(Azure.get_url())
remote.upload(PathInfo("foo"), to_info)
assert remote.exists(to_info)
# make sure the checksum is a hex number
int(remote.get_file_checksum(to_info), 16)