def test_from_file_string_sets_default_value_if_the_value_is_not_in_enum_names(
         self):
     item = EnumConfigItem("test_int", "test", ["test", "test1", "test2"])
     item.from_file_string("te")
     self.assertEqual(item.value(), "test")
 def test_init_sets_def_to_the_first_value_from_possible_enum_names_if_def_not_in_possible_names(
         self):
     item = EnumConfigItem("test_int", 1, [15, 16, 17])
     self.assertEqual(item._default, "15")
 def test_from_file_string_sets_stripped_string_value_if_it_is_in_enum_names(
         self):
     item = EnumConfigItem("test_int", "test", ["test", "test1", "test2"])
     item.from_file_string("   test2   ")
     self.assertEqual(item.value(), "test2")
    def test_init_sets_def_value_if_it_is_one_of_possible_enum_names(self):
        item = EnumConfigItem("test_int", 15, [15, 16, 17])
        self.assertEqual(item._default, "15")

        item = EnumConfigItem("test_int", "test", ["test", "test1", "test2"])
        self.assertEqual(item._default, "test")