Fix unit tests

This commit is contained in:
Luke Tainton 2024-04-21 15:41:35 +01:00
parent ca7c9a5226
commit aff7535c03
3 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class Config:
self.__admin_emails: list = os.environ["ADMIN_EMAIL"].split(",") self.__admin_emails: list = os.environ["ADMIN_EMAIL"].split(",")
self.__n8n_webhook_url: str = os.environ["N8N_WEBHOOK_URL"] self.__n8n_webhook_url: str = os.environ["N8N_WEBHOOK_URL"]
self.__sentry_dsn: str = os.environ.get("SENTRY_DSN", "") 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 @property
def environment(self) -> str: def environment(self) -> str:

0
tests/__init__.py Normal file
View File

View File

@ -11,6 +11,8 @@ vars: dict = {
"ADMIN_FIRST_NAME": "Test", "ADMIN_FIRST_NAME": "Test",
"ADMIN_EMAIL": "test@test.com", "ADMIN_EMAIL": "test@test.com",
"N8N_WEBHOOK_URL": "https://n8n.test.com/webhook/abcdefg", "N8N_WEBHOOK_URL": "https://n8n.test.com/webhook/abcdefg",
"SENTRY_ENABLED": "false",
"SENTRY_DSN": "http://localhost"
} }