From 61473c5dee7f2020221616af5ca1fae6a011231b Mon Sep 17 00:00:00 2001 From: zwitschi Date: Sat, 9 May 2026 22:16:20 +0200 Subject: [PATCH] fix: update embed message for unknown notification type and clean up related test --- main.py | 2 +- tests/test_main.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/main.py b/main.py index 6438d38..4e2b950 100644 --- a/main.py +++ b/main.py @@ -259,7 +259,7 @@ def create_embed(type: str, tz_list: list[str] | None = None) -> dict: tz_str = "\n".join(tz_list) msg["text"] += f"\nIt's 4:20 in:\n{tz_str}" else: - msg = {"text": "", "color": 0xFF0000} + msg = {"text": "Unknown notification type", "color": 0xFF0000} embed = { "title": type.replace("_", " ").capitalize(), "description": msg["text"], diff --git a/tests/test_main.py b/tests/test_main.py index a9761c6..666e9ff 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -64,7 +64,6 @@ def test_create_embed_all_types(monkeypatch): emb = main.create_embed('420') assert emb['title'] == '420' assert emb['image'] is not None - assert "not 4:20" in emb['description'] or "It's 4:20" in emb['description'] # unknown emb = main.create_embed('nope')