diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_subcmds.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_subcmds.py b/tests/test_subcmds.py index 73b66e3f..5ce0776f 100644 --- a/tests/test_subcmds.py +++ b/tests/test_subcmds.py | |||
| @@ -75,3 +75,17 @@ class AllCommands(unittest.TestCase): | |||
| 75 | msg=f"subcmds/{name}.py: {option.get_opt_string()}: " | 75 | msg=f"subcmds/{name}.py: {option.get_opt_string()}: " |
| 76 | f'help text should not end in a period: "{option.help}"', | 76 | f'help text should not end in a period: "{option.help}"', |
| 77 | ) | 77 | ) |
| 78 | |||
| 79 | def test_cli_option_style(self): | ||
| 80 | """Force some consistency in option flags.""" | ||
| 81 | for name, cls in subcmds.all_commands.items(): | ||
| 82 | cmd = cls() | ||
| 83 | parser = cmd.OptionParser | ||
| 84 | for option in parser.option_list: | ||
| 85 | for opt in option._long_opts: | ||
| 86 | self.assertNotIn( | ||
| 87 | "_", | ||
| 88 | opt, | ||
| 89 | msg=f"subcmds/{name}.py: {opt}: only use dashes in " | ||
| 90 | "options, not underscores", | ||
| 91 | ) | ||
