mcp issues
This commit is contained in:
@@ -8,8 +8,10 @@ class _AggregateClient:
|
||||
self.responses = list(responses)
|
||||
self.arguments = []
|
||||
self.schema = schema
|
||||
self.probes = 0
|
||||
|
||||
def probe(self):
|
||||
self.probes += 1
|
||||
status = {"status": "connected"}
|
||||
if self.schema:
|
||||
status["tool_schemas"] = {"aggregate_messages": self.schema}
|
||||
@@ -43,6 +45,14 @@ class GraylogAggregateTests(unittest.TestCase):
|
||||
self.assertEqual(status["aggregate_status"], "error")
|
||||
self.assertIn("probe_error", status["aggregate_error"])
|
||||
|
||||
def test_uses_existing_probe_status_without_reprobing(self):
|
||||
client = _AggregateClient([
|
||||
{"result": {"content": [{"type": "text", "text": '{"events": 9}'}]}}
|
||||
])
|
||||
status = GraylogAggregateSource(client, "firewall").fetch_count(probe_status={"status": "connected"})
|
||||
self.assertEqual(status["aggregate_events"], 9)
|
||||
self.assertEqual(client.probes, 0)
|
||||
|
||||
def test_tries_fallback_argument_shape_after_tool_error(self):
|
||||
client = _AggregateClient([
|
||||
{"result": {"isError": True, "content": [{"type": "text", "text": "bad metrics"}]}},
|
||||
|
||||
Reference in New Issue
Block a user