def test_defaults(self): """Check that default arguments are valid.""" default_options = self.defaults() # FIXME: We should not need to call parse() to determine # whether the default arguments are valid. parser = ArgumentParser(all_categories=self._all_categories(), base_filter_rules=[], default_options=default_options) # No need to test the return value here since we test parse() # on valid arguments elsewhere. # # The default options are valid: no error or SystemExit. parser.parse(args=[])
def _create_parser(self): """Return an ArgumentParser instance for testing.""" default_options = self._create_defaults() all_categories = ['build', 'whitespace'] mock_stderr = self._MockStdErr() return ArgumentParser(all_categories=all_categories, base_filter_rules=[], default_options=default_options, mock_stderr=mock_stderr, usage='test usage')
def check_blink_style_parser(): all_categories = _all_categories() default_options = _check_blink_style_defaults() return ArgumentParser(all_categories=all_categories, base_filter_rules=_BASE_FILTER_RULES, default_options=default_options)