fix(backups): make sure location and credentials get properly passed around

This commit is contained in:
Houkime 2023-05-22 16:01:57 +00:00 committed by Inex Code
parent c5c41b3ced
commit d10bf99927
2 changed files with 5 additions and 1 deletions

View file

@ -12,6 +12,7 @@ class AbstractBackupProvider(ABC):
def backuper(self) -> AbstractBackuper: def backuper(self) -> AbstractBackuper:
raise NotImplementedError raise NotImplementedError
def __init__(self, login="", key=""): def __init__(self, login="", key="", location=""):
self.backuper.set_creds(login, key, location)
self.login = login self.login = login
self.key = key self.key = key

View file

@ -109,6 +109,9 @@ def test_config_load(generic_userdata):
assert provider.login == "ID" assert provider.login == "ID"
assert provider.key == "KEY" assert provider.key == "KEY"
assert provider.backuper.account == "ID"
assert provider.backuper.key == "KEY"
def test_select_backend(): def test_select_backend():
provider = providers.get_provider(BackupProvider.BACKBLAZE) provider = providers.get_provider(BackupProvider.BACKBLAZE)