Fixed setup/ config_setup reference

pull/189/head
erinhmclark 2025-02-11 11:47:11 +00:00
rodzic 1792e02d1d
commit 89d9140d15
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -7,7 +7,7 @@ from auto_archiver.core.metadata import Metadata
from tests.storages.test_storage_base import TestStorageBase
class TestGDriveStorage(TestStorageBase):
class TestGDriveStorage:
"""
Test suite for GDriveStorage.
"""
@ -21,6 +21,10 @@ class TestGDriveStorage(TestStorageBase):
'service_account': 'fake_service_account.json'
}
@pytest.fixture(autouse=True)
def gdrive(self, setup_module):
with patch('google.oauth2.service_account.Credentials.from_service_account_file') as mock_creds:
self.storage = setup_module(self.module_name, self.config)
def test_initialize_fails_with_non_existent_creds(self):
"""
@ -28,13 +32,15 @@ class TestGDriveStorage(TestStorageBase):
"""
# Act and Assert
with pytest.raises(FileNotFoundError) as exc_info:
self.storage.setup(self.config)
self.storage.setup()
assert "No such file or directory" in str(exc_info.value)
def test_path_parts(self):
media = Media(filename="test.jpg")
media.key = "folder1/folder2/test.jpg"
@pytest.mark.skip(reason="Requires real credentials")
@pytest.mark.download
class TestGDriveStorageConnected(TestStorageBase):