feat: Telegram bot — full functionality with inline keyboards, file upload, auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-03 22:46:20 +05:00
parent 397b999558
commit 922b1b26a6
8 changed files with 439 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import pytest
from app.messengers.telegram.keyboards import (
template_choice_keyboard,
protocol_actions_keyboard,
recording_list_keyboard,
)
def test_template_choice_keyboard():
templates = [
{"id": "abc-123", "name": "Обследование"},
{"id": "def-456", "name": "Внутренняя"},
]
kb = template_choice_keyboard(templates)
assert len(kb.inline_keyboard) == 2
assert kb.inline_keyboard[0][0].text == "Обследование"
assert kb.inline_keyboard[0][0].callback_data == "template:abc-123"
def test_protocol_actions_keyboard():
kb = protocol_actions_keyboard("proto-123", "http://localhost")
assert len(kb.inline_keyboard) == 3
assert kb.inline_keyboard[0][0].callback_data == "export:proto-123:docx"
def test_recording_list_keyboard():
recordings = [
{"id": "rec-1", "title": "Meeting 1", "status": "done"},
{"id": "rec-2", "title": "Meeting 2", "status": "processing"},
]
kb = recording_list_keyboard(recordings)
assert len(kb.inline_keyboard) == 2
assert "" in kb.inline_keyboard[0][0].text
assert "⚙️" in kb.inline_keyboard[1][0].text