fix mcp
This commit is contained in:
@@ -23,6 +23,11 @@ class _ErrorClient:
|
||||
return {"result": {"isError": True, "content": [{"type": "text", "text": "Tool call failed: timeout"}]}}
|
||||
|
||||
|
||||
class _ProbeErrorClient:
|
||||
def probe(self):
|
||||
raise RuntimeError("connection refused")
|
||||
|
||||
|
||||
class GraylogSourceTests(unittest.TestCase):
|
||||
def test_applies_custom_mapping_to_generic_stream_message(self):
|
||||
client = _Client()
|
||||
@@ -56,6 +61,12 @@ class GraylogSourceTests(unittest.TestCase):
|
||||
self.assertTrue(status["partial"])
|
||||
self.assertIn("graylog_search_error", status["error"])
|
||||
|
||||
def test_returns_partial_status_instead_of_raising_on_probe_error(self):
|
||||
events, status = GraylogStreamSource(_ProbeErrorClient(), "vpn").fetch()
|
||||
self.assertEqual(events, [])
|
||||
self.assertTrue(status["partial"])
|
||||
self.assertIn("probe_error", status["error"])
|
||||
|
||||
def test_requests_selected_profile_fields(self):
|
||||
client = _Client()
|
||||
GraylogStreamSource(client, "windows", profile_fields=("TargetUserName", "EventID")).fetch()
|
||||
|
||||
Reference in New Issue
Block a user