Started the roadmap with incident grouping.

This commit is contained in:
larssand
2026-06-23 20:30:14 +02:00
parent e71f868be4
commit e3938c2581
3 changed files with 30 additions and 1 deletions

9
tests/test_incidents.py Normal file
View File

@@ -0,0 +1,9 @@
import unittest
from fgai.incidents import build_incidents
from fgai.models import AnomalyFinding
class IncidentTests(unittest.TestCase):
def test_merges_anomaly_and_correlation(self):
anomaly = AnomalyFinding("10.0.0.1", 60, "high", "high", ["burst"], {})
result = build_incidents([anomaly], {"10.0.0.1": [{"score": 15, "reason": "new domain"}]}, [{"source_ip": "10.0.0.1", "streams": ["DNS", "Firewall"]}])
self.assertEqual(result[0]["score"], 85)