From aff7535c03f6b1b8e93b04abaf1c883f29323558 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Sun, 21 Apr 2024 15:41:35 +0100 Subject: [PATCH] Fix unit tests --- app/utils/config.py | 2 +- tests/__init__.py | 0 tests/test_config.py | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/__init__.py diff --git a/app/utils/config.py b/app/utils/config.py index a62d235..5152b20 100644 --- a/app/utils/config.py +++ b/app/utils/config.py @@ -12,7 +12,7 @@ class Config: self.__admin_emails: list = os.environ["ADMIN_EMAIL"].split(",") self.__n8n_webhook_url: str = os.environ["N8N_WEBHOOK_URL"] self.__sentry_dsn: str = os.environ.get("SENTRY_DSN", "") - self.__sentry_enabled: bool = True if (os.environ.get("SENTRY_ENABLED").upper() == "TRUE" and self.__sentry_dsn != "") else False + self.__sentry_enabled: bool = True if (os.environ.get("SENTRY_ENABLED", "False").upper() == "TRUE" and self.__sentry_dsn != "") else False @property def environment(self) -> str: diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_config.py b/tests/test_config.py index ab41d77..ebebd1c 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -11,6 +11,8 @@ vars: dict = { "ADMIN_FIRST_NAME": "Test", "ADMIN_EMAIL": "test@test.com", "N8N_WEBHOOK_URL": "https://n8n.test.com/webhook/abcdefg", + "SENTRY_ENABLED": "false", + "SENTRY_DSN": "http://localhost" }