From 30ac99098513af721b24c74ee3d8c769d7356ba6 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 14 Apr 2023 12:29:23 +0000 Subject: [PATCH] refactor(backups): set a list of folders for our dummy service --- selfprivacy_api/services/test_service/__init__.py | 6 +++--- tests/test_graphql/test_backup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfprivacy_api/services/test_service/__init__.py b/selfprivacy_api/services/test_service/__init__.py index e790be9..c14feca 100644 --- a/selfprivacy_api/services/test_service/__init__.py +++ b/selfprivacy_api/services/test_service/__init__.py @@ -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]: diff --git a/tests/test_graphql/test_backup.py b/tests/test_graphql/test_backup.py index 460fa44..ff89ccb 100644 --- a/tests/test_graphql/test_backup.py +++ b/tests/test_graphql/test_backup.py @@ -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()