예제 #1
0
 def test_numeric_value(self):
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get("=="), 1, "1"))
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get("=="), 1, "1.0"))
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get(">"), "5", 1))
예제 #2
0
 def test_numeric_value_and_plain_string(self):
     self.assertEqual(Alert.UNKNOWN_STATE,
                      next_state(OPERATORS.get("=="), 1, "string"))
예제 #3
0
 def test_boolean_value(self):
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get("=="), False, "false"))
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get("!="), False, "true"))
예제 #4
0
 def test_string_value(self):
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get("=="), "string", "string"))
예제 #5
0
 def test_non_numeric_value(self):
     self.assertEqual(Alert.OK_STATE,
                      next_state(OPERATORS.get("=="), "1", "1.0"))
예제 #6
0
 def test_boolean_value(self):
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get('=='), False, 'false'))
     self.assertEqual(Alert.TRIGGERED_STATE,
                      next_state(OPERATORS.get('!='), False, 'true'))