mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 04:51:27 +00:00
refactor(backups): set a list of folders for our dummy service
This commit is contained in:
parent
47f2f857f6
commit
d38872072d
|
@ -15,8 +15,8 @@ from selfprivacy_api.services.test_service.icon import BITWARDEN_ICON
|
|||
class DummyService(Service):
|
||||
"""A test service"""
|
||||
|
||||
def __init_subclass__(cls, location):
|
||||
cls.location = location
|
||||
def __init_subclass__(cls, folders: List[str]):
|
||||
cls.folders = folders
|
||||
|
||||
@staticmethod
|
||||
def get_id() -> str:
|
||||
|
@ -113,7 +113,7 @@ class DummyService(Service):
|
|||
|
||||
@classmethod
|
||||
def get_folders(cls) -> List[str]:
|
||||
return [cls.location]
|
||||
return cls.folders
|
||||
|
||||
@staticmethod
|
||||
def get_dns_records() -> typing.List[ServiceDnsRecord]:
|
||||
|
|
|
@ -45,7 +45,7 @@ def raw_dummy_service(tmpdir, backups):
|
|||
file.write(TESTFILE_BODY)
|
||||
|
||||
# we need this to not change get_folders() much
|
||||
class TestDummyService(DummyService, location=service_dir):
|
||||
class TestDummyService(DummyService, folders=[service_dir]):
|
||||
pass
|
||||
|
||||
service = TestDummyService()
|
||||
|
|
Loading…
Reference in a new issue