mcp issues

This commit is contained in:
larssand
2026-06-30 12:47:31 +02:00
parent 86065eca59
commit c76e260516
5 changed files with 55 additions and 30 deletions

View File

@@ -6,8 +6,10 @@ from fgai.graylog_source import GraylogStreamSource
class _Client:
def __init__(self):
self.arguments = None
self.probes = 0
def probe(self):
self.probes += 1
return {"status": "connected"}
def call_tool(self, _name, arguments):
@@ -48,6 +50,11 @@ class GraylogSourceTests(unittest.TestCase):
GraylogStreamSource(client, "vpn").fetch(range_seconds=86_400)
self.assertEqual(client.arguments["range_seconds"], 86_400)
def test_uses_existing_probe_status_without_reprobing(self):
client = _Client()
GraylogStreamSource(client, "vpn").fetch(probe_status={"status": "connected"})
self.assertEqual(client.probes, 0)
def test_marks_stream_truncated_when_max_events_reached(self):
client = _Client()
events, status = GraylogStreamSource(client, "vpn").fetch(max_events=2)