ci: add dedicated test stage

This commit is contained in:
nyan404 committed 2026-08-21 13:27:42 +03:00
1 parent 532b4c7710
commit 9022d3b06a
5 files changed
+35 -21

No files matched your search

+13 -6
View File
@@ -263,19 +263,26 @@ class VkConversationTests(unittest.TestCase):
dialog.handle(502, answer)
self.assertIn("скриншот", dialog.handle(502, "несам").lower())
def test_compact_command_accepts_all_independence_variants(self):
for value, expected in (
def test_compact_zu_command_rejects_non_self_variants(self):
for value in (
("сам", "самостоятельно"),
("самостоятельный", "самостоятельно"),
("самостоятельно", "самостоятельно"),
):
parsed = parse_text_command(
f"/зу 16.08 10:00 10:10 | Белка [1] | Малыш [2] | {value[0]}"
)
self.assertEqual(parsed["kitten_independence"], value[1])
for value in (
("несам", "несамостоятельно"),
("несамостоятельный", "несамостоятельно"),
("несамостоятельно", "несамостоятельно"),
):
parsed = parse_text_command(
f"/зу 16.08 10:00 10:10 | Белка [1] | Малыш [2] | {value}"
)
self.assertEqual(parsed["kitten_independence"], expected)
with self.assertRaisesRegex(ValueError, "Для ЗУ все котята должны быть самостоятельными"):
parse_text_command(
f"/зу 16.08 10:00 10:10 | Белка [1] | Малыш [2] | {value[0]}"
)
def test_keyboard_changes_with_dialog_state(self):
dialog = BelkiDialog()