feat: add cat identity rename flow

This commit is contained in:
nyan404 committed 2026-10-13 00:30:36 +03:00
1 parent a15c22b4a2
commit 546fa37fce
10 files changed
+203 -14

No files matched your search

+10
View File
@@ -458,6 +458,16 @@ class VkConversationTests(unittest.TestCase):
dialog.handle(901, "1")
self.assertIn("Куратор: 4", dialog.handle(901, "сам"))
def test_identity_rename_has_menu_button_and_updates_existing_mapping(self):
identities = IdentityDirectory([Identity("Серолап", 1617140)])
dialog = BelkiDialog(identities)
labels = [button["action"]["label"] for row in dialog.keyboard_for(902)["buttons"] for button in row]
self.assertIn("Изменить имя кота", labels)
self.assertIn("Укажите ID кота", dialog.handle(902, "/изменить-имя"))
self.assertIn("Серолап", dialog.handle(902, "1617140"))
self.assertIn("Серолап", dialog.handle(902, "Новый Лап"))
self.assertEqual(identities.resolve(character_id=1617140).name, "Новый Лап")
if __name__ == "__main__":
unittest.main()