Implemented the next roadmap step: direct Graylog MCP replay with temporary baselines.
This commit is contained in:
39
tests/test_cli.py
Normal file
39
tests/test_cli.py
Normal 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()
|
||||
Reference in New Issue
Block a user