feat: calculate inspection resource points

This commit is contained in:
nyan404 committed 2026-08-16 16:41:31 +03:00
1 parent 5809d5a595
commit 21652d0001
6 files changed
+46 -2

No files matched your search

+1
View File
@@ -41,6 +41,7 @@ class ApiTests(unittest.TestCase):
}
)
self.assertIn("осмотрел(-а) дупло 6 раз", response["message"])
self.assertEqual(response["result"]["points"], 17)
def test_bulk_inspection_payload_explains_missing_fields(self):
response = inspect_bulk_payload({"text": "/лу 15.08 11:00 11:20 | Белка [1] | Котёнок [2]"})
+11
View File
@@ -5,6 +5,7 @@ from app.belki.domain import (
InspectionReport,
TrainingSession,
calculate_coaching,
calculate_inspection,
calculate_training,
format_clock,
parse_clock,
@@ -112,6 +113,16 @@ class ReportTests(unittest.TestCase):
self.assertIn("-2 вьюнок.", text)
self.assertIn("+1 паук.", text)
self.assertNotIn("Скриншот", text)
self.assertIn("Баллы осмотра: 17 баллы.", text)
def test_inspection_points_include_attempts_and_resource_values(self):
report = InspectionReport(
character_name="Дикая Вишня", character_id=1604614,
place="дупло", inspections=2,
resources=(("паутина", 1), ("надпись", 1)),
)
self.assertEqual(calculate_inspection(report).points, 11)
self.assertIn("Баллы осмотра: 11 баллы.", render_inspection(report))
if __name__ == "__main__":