Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/tests/test_objstorage_azure.py
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | def list_blobs(self, container_name, marker=None, maxresults=None): | ||||
yield MockBlob(name=blob_name, content=content) | yield MockBlob(name=blob_name, content=content) | ||||
class TestAzureCloudObjStorage(ObjStorageTestFixture, unittest.TestCase): | class TestAzureCloudObjStorage(ObjStorageTestFixture, unittest.TestCase): | ||||
def setUp(self): | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
patcher = patch( | patcher = patch( | ||||
'swh.objstorage.cloud.objstorage_azure.BlockBlobService', | 'swh.objstorage.backends.azure.BlockBlobService', | ||||
MockBlockBlobService, | MockBlockBlobService, | ||||
) | ) | ||||
patcher.start() | patcher.start() | ||||
self.addCleanup(patcher.stop) | self.addCleanup(patcher.stop) | ||||
self.storage = get_objstorage('azure', { | self.storage = get_objstorage('azure', { | ||||
'account_name': 'account-name', | 'account_name': 'account-name', | ||||
'api_secret_key': 'api-secret-key', | 'api_secret_key': 'api-secret-key', | ||||
'container_name': 'container-name', | 'container_name': 'container-name', | ||||
}) | }) | ||||
class TestPrefixedAzureCloudObjStorage(ObjStorageTestFixture, | class TestPrefixedAzureCloudObjStorage(ObjStorageTestFixture, | ||||
unittest.TestCase): | unittest.TestCase): | ||||
def setUp(self): | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
patcher = patch( | patcher = patch( | ||||
'swh.objstorage.cloud.objstorage_azure.BlockBlobService', | 'swh.objstorage.backends.azure.BlockBlobService', | ||||
MockBlockBlobService, | MockBlockBlobService, | ||||
) | ) | ||||
patcher.start() | patcher.start() | ||||
self.addCleanup(patcher.stop) | self.addCleanup(patcher.stop) | ||||
self.accounts = {} | self.accounts = {} | ||||
for prefix in '0123456789abcdef': | for prefix in '0123456789abcdef': | ||||
self.accounts[prefix] = { | self.accounts[prefix] = { | ||||
Show All 36 Lines |