add test to see if fail for streams and evetns
This commit is contained in:
@@ -32,6 +32,10 @@ class DashboardTests(unittest.TestCase):
|
||||
self.assertIn("Update profile", HTML)
|
||||
self.assertIn("function mergeProfile", HTML)
|
||||
|
||||
def test_dashboard_has_direct_stream_selection_save(self):
|
||||
self.assertIn("Save streams", HTML)
|
||||
self.assertIn("function saveStreamSelection", HTML)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -106,6 +106,26 @@ class MonitorTests(unittest.TestCase):
|
||||
self.assertEqual(coverage["firewall"]["readiness"], "1/1")
|
||||
self.assertEqual(coverage["dns"]["health"], "missing_profile")
|
||||
|
||||
def test_graylog_mcp_without_enabled_streams_reports_clear_status(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
config_path = Path(tmp) / "config.json"
|
||||
config_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"log_source": "graylog_mcp",
|
||||
"graylog_mcp_url": "https://graylog.example/api/mcp",
|
||||
"graylog_mcp_token": "token",
|
||||
"graylog_streams": [{"id": "disabled", "title": "Disabled", "enabled": False}],
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
status = build_status(str(Path(tmp) / "missing.log"), config_path=str(config_path), incident_path=str(Path(tmp) / "incidents.json"))
|
||||
|
||||
self.assertEqual(status["capabilities"]["graylog_mcp"]["status"], "no_streams_enabled")
|
||||
self.assertEqual(status["summary"]["total"], 0)
|
||||
|
||||
def test_add_llm_assessment_records_error_without_ollama(self):
|
||||
status = {"summary": {}, "anomalies": []}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user