Example #1
0
    def setUp(self):
        """ Set up the test fixtures """
        self.enum_factory_class = enum.Enum
        ValuesFixture.setUp(self)

        self.iterate_params = tools.make_params_iterator(
            default_params_dict=self.valid_values)
Example #2
0
    def setUp(self):
        """ Set up test fixtures """
        self.valid_exceptions = {
            enum.EnumEmptyError:
            dict(
                min_args=0,
                types=(enum.EnumException, AssertionError),
            ),
            enum.EnumBadKeyError:
            dict(
                min_args=1,
                types=(enum.EnumException, TypeError),
            ),
            enum.EnumImmutableError:
            dict(
                min_args=1,
                types=(enum.EnumException, TypeError),
            ),
        }

        for exc_type, params in self.valid_exceptions.items():
            args = (None, ) * params['min_args']
            instance = exc_type(*args)
            self.valid_exceptions[exc_type]['instance'] = instance

        self.iterate_params = tools.make_params_iterator(
            default_params_dict=self.valid_exceptions)
Example #3
0
    def setUp(self):
        """ Set up test fixtures """
        self.valid_exceptions = {
            enum.EnumEmptyError: dict(
                min_args = 0,
                types = (enum.EnumException, AssertionError),
            ),
            enum.EnumBadKeyError: dict(
                min_args = 1,
                types = (enum.EnumException, TypeError),
            ),
            enum.EnumImmutableError: dict(
                min_args = 1,
                types = (enum.EnumException, TypeError),
            ),
        }

        for exc_type, params in self.valid_exceptions.items():
            args = (None,) * params['min_args']
            instance = exc_type(*args)
            self.valid_exceptions[exc_type]['instance'] = instance

        self.iterate_params = tools.make_params_iterator(
            default_params_dict = self.valid_exceptions
        )
Example #4
0
    def setUp(self):
        """ Set up the test fixtures """
        self.enum_factory_class = enum.Enum
        ValuesFixture.setUp(self)

        self.iterate_params = tools.make_params_iterator(
            default_params_dict = self.valid_values
        )