Add GitHub webhook receiver

This commit is contained in:
2026-07-01 21:41:01 +02:00
parent 36170f83d1
commit 62ea12033f
9 changed files with 706 additions and 7 deletions

32
tests/test_dispatcher.py Normal file
View File

@@ -0,0 +1,32 @@
from __future__ import annotations
import unittest
from types import SimpleNamespace
from unittest.mock import AsyncMock
from app.commands import CommandDispatcher, CommandRegistry
class CommandDispatcherTests(unittest.IsolatedAsyncioTestCase):
async def test_unknown_owner_command_is_silent(self) -> None:
dispatcher = CommandDispatcher(CommandRegistry())
message = SimpleNamespace(
text=".missing",
from_user=SimpleNamespace(id=123),
reply_text=AsyncMock(),
)
account = SimpleNamespace(me=SimpleNamespace(id=123))
handled = await dispatcher.dispatch(
client=SimpleNamespace(),
message=message,
manager=SimpleNamespace(),
account=account,
)
self.assertTrue(handled)
message.reply_text.assert_not_awaited()
if __name__ == "__main__":
unittest.main()