Files
dvc/tests/unit/remote/test_azure.py
T
Peter Rowlands (변기호) dfe184f149 tests: convert remote unit tests to pytest (#3604)
- update tests/unit/remote tests to use pytest style tests
- use pytest dvc repo fixtures instead of improperly mocked repo's or
  None
2020-04-07 10:45:49 +03:00

32 lines
1.0 KiB
Python

from dvc.remote.azure import RemoteAZURE
container_name = "container-name"
connection_string = (
"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;"
"AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsu"
"Fq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;"
"BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
)
def test_init_compat(dvc):
url = (
"azure://ContainerName={container_name};{connection_string}"
).format(
container_name=container_name, connection_string=connection_string,
)
config = {"url": url}
remote = RemoteAZURE(dvc, config)
assert remote.path_info == "azure://" + container_name
assert remote.connection_string == connection_string
def test_init(dvc):
prefix = "some/prefix"
url = "azure://{}/{}".format(container_name, prefix)
config = {"url": url, "connection_string": connection_string}
remote = RemoteAZURE(dvc, config)
assert remote.path_info == url
assert remote.connection_string == connection_string