Implemented the next roadmap step: direct Graylog MCP replay with temporary baselines.

This commit is contained in:
larssand
2026-06-25 18:34:51 +02:00
parent ea4aaf57ed
commit b6560d64f7
8 changed files with 195 additions and 7 deletions

39
tests/test_cli.py Normal file
View File

@@ -0,0 +1,39 @@
import unittest
from fgai.cli import _configured_streams
class CliTests(unittest.TestCase):
def test_configured_streams_uses_enabled_streams_by_default(self):
config = {
"graylog_streams": [
{"id": "fortigate", "title": "Fortigate", "enabled": True},
{"id": "adguard", "title": "Adguard", "enabled": False},
]
}
self.assertEqual(_configured_streams(config), [{"id": "fortigate", "title": "Fortigate"}])
def test_configured_streams_can_select_disabled_stream(self):
config = {
"graylog_streams": [
{"id": "fortigate", "title": "Fortigate", "enabled": True},
{"id": "adguard", "title": "Adguard", "enabled": False},
]
}
self.assertEqual(_configured_streams(config, ["adguard"]), [{"id": "adguard", "title": "Adguard"}])
def test_configured_streams_preserves_selected_order(self):
config = {
"graylog_streams": [
{"id": "fortigate", "title": "Fortigate", "enabled": True},
{"id": "adguard", "title": "Adguard", "enabled": False},
]
}
self.assertEqual(
_configured_streams(config, ["adguard", "fortigate"]),
[{"id": "adguard", "title": "Adguard"}, {"id": "fortigate", "title": "Fortigate"}],
)
if __name__ == "__main__":
unittest.main()