mcp issues
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user