feat: add maintenance module for message deletion and related utilities
Build and Deploy Docker Container / test (push) Successful in 37s
Build and Deploy Docker Container / build-and-deploy (push) Failing after 1m3s

feat: implement tests for maintenance functions and dashboard interactions
feat: add timezone and country tests for thctime module
This commit is contained in:
2026-05-10 12:36:02 +02:00
parent 01d94376d4
commit a4c92470b6
8 changed files with 679 additions and 470 deletions
+25
View File
@@ -0,0 +1,25 @@
import main
def test_main_exits_quickly(monkeypatch):
monkeypatch.setattr(main, "send_notification", lambda x: None)
monkeypatch.setattr(main, "start_dashboard", lambda: None)
monkeypatch.setattr(main.schedule, "run_pending", lambda: (
_ for _ in ()).throw(KeyboardInterrupt()))
monkeypatch.setattr(main.time, "sleep", lambda s: None)
monkeypatch.setenv("DISCORD_WEBHOOK_URL", "http://example.com/webhook")
main.WEBHOOK_URL = "http://example.com/webhook"
main.main()
def test_get_next_scheduled_event():
now = main.datetime(2025, 1, 1, 10, 14, 30)
nxt = main.get_next_scheduled_event(now)
assert nxt["type"] == "reminder"
assert nxt["at"].hour == 10 and nxt["at"].minute == 15
now = main.datetime(2025, 1, 1, 10, 50, 1)
nxt = main.get_next_scheduled_event(now)
assert nxt["type"] == "reminder"
assert nxt["at"].hour == 11 and nxt["at"].minute == 15