From 0a1d7733f875795cf9bccea6eb4af18b70e02128 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 5 Jun 2024 11:01:38 +0000 Subject: [PATCH] test(services): add more debug to the test service --- selfprivacy_api/services/test_service/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/selfprivacy_api/services/test_service/__init__.py b/selfprivacy_api/services/test_service/__init__.py index caf4666..d98c041 100644 --- a/selfprivacy_api/services/test_service/__init__.py +++ b/selfprivacy_api/services/test_service/__init__.py @@ -92,8 +92,18 @@ class DummyService(Service): @classmethod def get_status(cls) -> ServiceStatus: + filepath = cls.status_file() + if filepath in [None, ""]: + raise ValueError(f"We do not have a path for our test dummy status file!") + if not path.exists(filepath): + raise FileNotFoundError(filepath) + with open(cls.status_file(), "r") as file: status_string = file.read().strip() + if status_string in [None, ""]: + raise NotImplementedError( + f"It appears our test service no longer has any status in the statusfile. Filename = {cls.status_file}, status string inside is '{status_string}' (quoted) " + ) return ServiceStatus[status_string] @classmethod