refactor(backups): set a list of folders for our dummy service

This commit is contained in:
Houkime 2023-04-14 12:29:23 +00:00
parent fa26379a68
commit 30ac990985
2 changed files with 4 additions and 4 deletions

View file

@ -15,8 +15,8 @@ from selfprivacy_api.services.test_service.icon import BITWARDEN_ICON
class DummyService(Service): class DummyService(Service):
"""A test service""" """A test service"""
def __init_subclass__(cls, location): def __init_subclass__(cls, folders: List[str]):
cls.location = location cls.folders = folders
@staticmethod @staticmethod
def get_id() -> str: def get_id() -> str:
@ -113,7 +113,7 @@ class DummyService(Service):
@classmethod @classmethod
def get_folders(cls) -> List[str]: def get_folders(cls) -> List[str]:
return [cls.location] return cls.folders
@staticmethod @staticmethod
def get_dns_records() -> typing.List[ServiceDnsRecord]: def get_dns_records() -> typing.List[ServiceDnsRecord]:

View file

@ -45,7 +45,7 @@ def raw_dummy_service(tmpdir, backups):
file.write(TESTFILE_BODY) file.write(TESTFILE_BODY)
# we need this to not change get_folders() much # we need this to not change get_folders() much
class TestDummyService(DummyService, location=service_dir): class TestDummyService(DummyService, folders=[service_dir]):
pass pass
service = TestDummyService() service = TestDummyService()