mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 13:01:28 +00:00
test(backups): localfile repo by default in tests
This commit is contained in:
parent
7cb6ca9641
commit
090198c300
|
@ -15,9 +15,16 @@ class Backups(metaclass=SingletonMetaclass):
|
|||
|
||||
provider: AbstractBackupProvider
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, test_repo_file: str = ""):
|
||||
if test_repo_file != "":
|
||||
self.set_localfile_repo(test_repo_file)
|
||||
self.lookup_provider()
|
||||
|
||||
def set_localfile_repo(self, file_path: str):
|
||||
ProviderClass = get_provider(BackupProvider.FILE)
|
||||
provider = ProviderClass(file_path)
|
||||
self.provider = provider
|
||||
|
||||
def lookup_provider(self):
|
||||
redis_provider = Backups.load_provider_redis()
|
||||
if redis_provider is not None:
|
||||
|
|
|
@ -50,8 +50,9 @@ def file_backup(tmpdir) -> AbstractBackupProvider:
|
|||
|
||||
|
||||
@pytest.fixture()
|
||||
def backups():
|
||||
return Backups()
|
||||
def backups(tmpdir):
|
||||
test_repo_path = path.join(tmpdir, "test_repo")
|
||||
return Backups(test_repo_path)
|
||||
|
||||
|
||||
def test_select_backend():
|
||||
|
|
Loading…
Reference in a new issue