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