fix: update embed message for unknown notification type and clean up related test
This commit is contained in:
@@ -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"],
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user