fix(domain): validate participant name types

This commit is contained in:
nyan404 committed 2026-08-25 04:10:17 +03:00
1 parent 9dbf98fee1
commit f435b64d3c
3 files changed
+13 -2

No files matched your search

+9
View File
@@ -102,6 +102,15 @@ class CalculationTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, "разными персонажами"):
TrainingSession("Белка", 1, "Белка", 1)
def test_sessions_reject_non_text_participant_names_with_a_domain_error(self):
with self.assertRaisesRegex(ValueError, "Имена участников"):
TrainingSession("Белка", 1, None, 2) # type: ignore[arg-type]
with self.assertRaisesRegex(ValueError, "дополнительного котёнка"):
CoachingSession(
"15.08", "ЛУ", "11:00", "12:00", "Белка", 1, "Первый", 2,
extra_kittens=((None, 3, "самостоятельно"),), # type: ignore[arg-type]
)
def test_zu_rejects_non_self_kitten(self):
with self.assertRaisesRegex(ValueError, "Для ЗУ все котята должны быть самостоятельными"):
CoachingSession(