azure: support prefix

Fixes #1336

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-12-12 19:54:41 +02:00
parent ed3030707f
commit eaa2d559db
3 changed files with 37 additions and 14 deletions
+14 -3
View File
@@ -141,10 +141,16 @@ def get_gcp_url():
return 'gs://' + get_gcp_storagepath()
def get_azure_url():
def get_azure_url_compat():
return 'azure://'
def get_azure_url():
container_name = os.getenv("AZURE_STORAGE_CONTAINER_NAME")
assert container_name is not None
return 'azure://{}/{}'.format(container_name, str(uuid.uuid4()))
def sleep():
# Sleep some time to simulate realistic behavior.
# Some filesystems have a bad date resolution for
@@ -312,17 +318,22 @@ class TestRemoteGS(TestDataCloudBase):
return RemoteGS
class TestRemoteAzure(TestDataCloudBase):
class TestRemoteAzureCompat(TestDataCloudBase):
def _should_test(self):
return _should_test_azure()
def _get_url(self):
return get_azure_url()
return get_azure_url_compat()
def _get_cloud_class(self):
return RemoteAzure
class TestRemoteAzure(TestRemoteAzureCompat):
def _get_url(self):
return get_azure_url()
class TestRemoteLOCAL(TestDataCloudBase):
def _should_test(self):
return True