fix(domain): bound public report input sizes

This commit is contained in:
nyan404 committed 2026-08-25 03:50:35 +03:00
1 parent 1c2bfa9594
commit c0a6f6286e
7 files changed
+39 -4

No files matched your search

+9
View File
@@ -77,6 +77,15 @@ class CalculationTests(unittest.TestCase):
),
)
def test_domain_rejects_excessive_coaching_and_inspection_input(self):
extras = tuple((f"Котёнок {index}", index + 2, "самостоятельно") for index in range(50))
with self.assertRaisesRegex(ValueError, "не более 50 котят"):
CoachingSession("15.08", "ЛУ", "11:00", "12:00", "Белка", 1, "Первый", 2, extra_kittens=extras)
with self.assertRaisesRegex(ValueError, "от 0 до 100000"):
InspectionReport("Белка", 1, "дупло", 100001)
with self.assertRaisesRegex(ValueError, "не более 100 ресурсов"):
InspectionReport("Белка", 1, "дупло", 1, tuple(("вьюнок", 1) for _ in range(101)))
def test_zu_rejects_non_self_kitten(self):
with self.assertRaisesRegex(ValueError, "Для ЗУ все котята должны быть самостоятельными"):
CoachingSession(