Add checkbox for telegram notifications

This commit is contained in:
blankhex committed 2026-10-25 10:01:20 +03:00
1 parent e65d1ac46b
commit d4257e7dab
10 files changed
+74 -15

No files matched your search

+9 -1
View File
@@ -20,7 +20,7 @@ from meetings_telegram_bot.state import StateStore
now = datetime.now(timezone.utc)
def mk(i, title="T", room=None, sched=None):
def mk(i, title="T", room=None, sched=None, has_notification=True):
return Meeting(
id=i,
title=title,
@@ -30,6 +30,7 @@ def mk(i, title="T", room=None, sched=None):
created_by=1,
created_by_name="Roman",
created_at=now,
has_notification=has_notification,
)
@@ -110,6 +111,13 @@ def test_polling():
assert b4.poll_once() == 0 and len(tb.sent) == 1 # stale not posted
print("run4 (stale) announced 0 sent 1")
api._m.append(mk(6, title="Silent", has_notification=False))
b5 = MeetingsBot(cfg, api=api, bot=tb, store=StateStore(cfg.state_file))
b5.start()
assert b5.poll_once() == 0 and len(tb.sent) == 1 # no-notification not posted
assert 6 in b5.state.seen_meeting_ids
print("run5 (no notification) announced 0 sent 1")
print("ALL GOOD")