示例#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'))