feat: add context-aware VK keyboards

This commit is contained in:
nyan404 committed 2026-08-16 15:21:55 +03:00
1 parent 4dab6e8624
commit dfc5e2826a
6 files changed
+91 -8

No files matched your search

+11
View File
@@ -143,6 +143,17 @@ class VkConversationTests(unittest.TestCase):
dialog.handle(502, answer)
self.assertIn("несамостоятельно", dialog.handle(502, "несам").lower())
def test_keyboard_changes_with_dialog_state(self):
dialog = BelkiDialog()
menu = dialog.keyboard_for(503)
labels = [button["action"]["label"] for row in menu["buttons"] for button in row]
self.assertIn("Прокачка ЛУ", labels)
dialog.handle(503, "/лу")
for answer in ("15.08", "11:00", "11:20", "Дикая Вишня [1604614]", "Серолап [1617140]"):
dialog.handle(503, answer)
labels = [button["action"]["label"] for row in dialog.keyboard_for(503)["buttons"] for button in row]
self.assertEqual(labels[:2], ["Сам", "Несам"])
if __name__ == "__main__":
unittest.main()