Update test_provider.py

This commit is contained in:
Chris Pietschmann 2025-02-18 15:04:49 -05:00
parent 56060db29d
commit 2c328cc7c9

View File

@ -284,14 +284,6 @@ class TestGCSStorageProvider:
class TestAzureStorageProvider:
@pytest.fixture(autouse=True)
def setup_storage(self, monkeypatch):
self.Storage = provider.AzureStorageProvider()
self.Storage.endpoint = "https://myaccount.blob.core.windows.net"
self.Storage.container_name = "my-container"
self.file_content = b"test content"
self.filename = "test.txt"
self.filename_extra = "test_extra.txt"
self.file_bytesio_empty = io.BytesIO()
# Create mock Blob Service Client and related clients
mock_blob_service_client = MagicMock()
mock_container_client = MagicMock()
@ -312,6 +304,15 @@ class TestAzureStorageProvider:
azure.storage.blob, "BlobClient", lambda *args, **kwargs: mock_blob_client
)
self.Storage = provider.AzureStorageProvider()
self.Storage.endpoint = "https://myaccount.blob.core.windows.net"
self.Storage.container_name = "my-container"
self.file_content = b"test content"
self.filename = "test.txt"
self.filename_extra = "test_extra.txt"
self.file_bytesio_empty = io.BytesIO()
# Apply mocks to the Storage instance
self.Storage.blob_service_client = mock_blob_service_client
self.Storage.container_client = mock_container_client