Пример #1
0
    def test_known_values(self):
        "standard_value should return with the known values"
        known_values = (
                ("o", {"out":4}, 4),
                ("out", {"out":4, "outer":5}, 4),

            )
        for value, values, result in known_values:
            standard_value = StandardValue(values)
            self.assertEqual(standard_value.get(value), result)
Пример #2
0
    def test_case_insensitivity(self):
        "standard_value should neglect cases"
        known_values = (
                ("O", {"out":4}, 4),
                ("oUt", {"out":4}, 4),
                ("Out", {"out":4}, 4),
                ("OUT", {"out":4}, 4),

            )
        for value, values, result in known_values:
            standard_value = StandardValue(values)
            self.assertEqual(standard_value.get(value), result)
Пример #3
0
 def test_standard_values(self):
     "standard_value should return the standard values unchanged"
     values = {"in":2, "out":1, "all":3}
     standard_value = StandardValue(values)
     for value in values.values():
         self.assertEqual(standard_value.get(value), value)