fix(goal): bound public calculator inputs

This commit is contained in:
nyan404 committed 2026-08-25 03:34:58 +03:00
1 parent 041d717439
commit 5d6e5987d1
8 files changed
+58 -8

No files matched your search

+8
View File
@@ -18,6 +18,14 @@ class VkConversationTests(unittest.TestCase):
self.assertIn("/отмена", HELP_TEXT)
self.assertNotIn("Для детей", HELP_TEXT)
def test_goal_dialog_rejects_non_finite_and_unbounded_values(self):
dialog = BelkiDialog()
self.assertIn("баллов", dialog.handle(110, "/цель").lower())
self.assertIn("конечным", dialog.handle(110, "NaN").lower())
dialog.handle(110, "0")
dialog.handle(110, "10")
self.assertIn("от 1 до 1440", dialog.handle(110, "1441"))
def test_step_by_step_coaching_dialog(self):
dialog = BelkiDialog()
self.assertIn("дат", dialog.handle(77, "/лу").lower())