コード例 #1
0
 def test_valid_event(self, aggregator):
     check = AgentCheck()
     event = {
         "event_type": "new.event",
         "msg_title": "new test event",
         "aggregation_key": "test.event",
         "msg_text": "test event test event",
         "tags": None,
     }
     check.event(event)
     aggregator.assert_event('test event test event')
コード例 #2
0
 def test_valid_event(self, aggregator):
     check = AgentCheck()
     event = {
         "event_type": "new.event",
         "msg_title": "new test event",
         "aggregation_key": "test.event",
         "msg_text": "test event test event",
         "tags": ["foo", "bar"],
         "timestamp": 1,
     }
     check.event(event)
     aggregator.assert_event('test event test event', tags=["foo", "bar"])
コード例 #3
0
 def test_encoding(self, aggregator, msg_text):
     check = AgentCheck()
     event = {
         'event_type': 'new.event',
         'msg_title': 'new test event',
         'aggregation_key': 'test.event',
         'msg_text': msg_text,
         'tags': ['∆', u'Ω-bar'],
         'timestamp': 1,
     }
     check.event(event)
     aggregator.assert_event(to_string(msg_text), tags=['∆', 'Ω-bar'])
コード例 #4
0
 def test_namespace(self, aggregator):
     check = AgentCheck()
     check.__NAMESPACE__ = 'test'
     event = {
         'event_type': 'new.event',
         'msg_title': 'new test event',
         'aggregation_key': 'test.event',
         'msg_text': 'test event test event',
         'tags': None,
     }
     check.event(event)
     aggregator.assert_event('test event test event', source_type_name='test')