feat: migrate VK bot to Callback API

This commit is contained in:
nyan404 committed 2026-10-10 21:33:56 +03:00
1 parent 2794546974
commit a04498d634
10 files changed
+438 -58

No files matched your search

+8
View File
@@ -242,6 +242,14 @@ class VkConversationTests(unittest.TestCase):
self.assertIn("подтверд", confirmation.lower())
self.assertEqual(recreated._states[204]["attachments"][0]["url"], "https://example.test/history.jpg")
def test_callback_event_claim_is_idempotent_and_releasable(self):
with TemporaryDirectory() as directory:
store = VkConversationStore(sqlite_path=f"{directory}/vk.sqlite3")
self.assertTrue(store.claim_callback_event("event-1", "message_new"))
self.assertFalse(store.claim_callback_event("event-1", "message_new"))
store.release_callback_event("event-1")
self.assertTrue(store.claim_callback_event("event-1", "message_new"))
def test_inspection_character_without_directory_offers_pairing(self):
dialog = BelkiDialog(IdentityDirectory())
dialog.handle(105, "/осмотр")