fix group agg
This commit is contained in:
@@ -45,6 +45,20 @@ class GraylogAggregateTests(unittest.TestCase):
|
||||
self.assertEqual(status["aggregate_events"], 42)
|
||||
self.assertEqual(len(client.arguments), 2)
|
||||
|
||||
def test_fallbacks_only_use_graylog_supported_aggregate_fields(self):
|
||||
client = _AggregateClient([
|
||||
{"result": {"isError": True, "content": [{"type": "text", "text": "bad count parens"}]}},
|
||||
{"result": {"isError": True, "content": [{"type": "text", "text": "bad count"}]}},
|
||||
{"result": {"isError": True, "content": [{"type": "text", "text": "bad object metric"}]}},
|
||||
])
|
||||
|
||||
status = GraylogAggregateSource(client, "firewall").fetch_count()
|
||||
|
||||
self.assertEqual(status["aggregate_status"], "error")
|
||||
self.assertEqual(len(client.arguments), 3)
|
||||
for arguments in client.arguments:
|
||||
self.assertEqual(set(arguments), {"query", "streams", "range_seconds", "groupings", "metrics"})
|
||||
|
||||
def test_uses_tool_schema_to_avoid_unsupported_fields(self):
|
||||
schema = {"properties": {"query": {}, "streams": {}, "range_seconds": {}, "metrics": {}, "groupings": {}}}
|
||||
client = _AggregateClient([
|
||||
|
||||
Reference in New Issue
Block a user