Ejemplo n.º 1
0
 def test_severity_at_least(self):
     ct = get_alert_condition_from_string('severity at least')
     self.assertEqual(ct, AlertCondition.SEVERITY_AT_LEAST)
Ejemplo n.º 2
0
 def test_filter_count_at_least(self):
     ct = get_alert_condition_from_string('filter count at least')
     self.assertEqual(ct, AlertCondition.FILTER_COUNT_AT_LEAST)
Ejemplo n.º 3
0
 def test_filter_count_changed(self):
     ct = get_alert_condition_from_string('filter count changed')
     self.assertEqual(ct, AlertCondition.FILTER_COUNT_CHANGED)
Ejemplo n.º 4
0
 def test_always(self):
     ct = get_alert_condition_from_string('always')
     self.assertEqual(ct, AlertCondition.ALWAYS)
Ejemplo n.º 5
0
 def test_none_or_empty(self):
     ct = get_alert_condition_from_string(None)
     self.assertIsNone(ct)
     ct = get_alert_condition_from_string('')
     self.assertIsNone(ct)
Ejemplo n.º 6
0
 def test_invalid(self):
     with self.assertRaises(InvalidArgument):
         get_alert_condition_from_string('foo')
Ejemplo n.º 7
0
 def test_error(self):
     ct = get_alert_condition_from_string('error')
     self.assertEqual(ct, AlertCondition.ERROR)
Ejemplo n.º 8
0
 def test_severity_changed(self):
     ct = get_alert_condition_from_string('severity changed')
     self.assertEqual(ct, AlertCondition.SEVERITY_CHANGED)