mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-16 07:33:16 +00:00
refactor(backups): set a list of folders for our dummy service
This commit is contained in:
parent
fa26379a68
commit
30ac990985
|
@ -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]:
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue