(self)
| 2907 | ''')) |
| 2908 | |
| 2909 | def test_parser_command_help(self): |
| 2910 | self.assertEqual(self.command_help_parser.format_usage(), |
| 2911 | 'usage: PROG [-h] [--foo] bar {1,2,3} ...\n') |
| 2912 | self.assertEqual(self.command_help_parser.format_help(), |
| 2913 | textwrap.dedent('''\ |
| 2914 | usage: PROG [-h] [--foo] bar {1,2,3} ... |
| 2915 | |
| 2916 | main description |
| 2917 | |
| 2918 | positional arguments: |
| 2919 | bar bar help |
| 2920 | {1,2,3} command help |
| 2921 | 1 1 help |
| 2922 | 2 2 help |
| 2923 | 3 3 help |
| 2924 | |
| 2925 | options: |
| 2926 | -h, --help show this help message and exit |
| 2927 | --foo foo help |
| 2928 | ''')) |
| 2929 | |
| 2930 | def assert_bad_help(self, context_type, func, *args, **kwargs): |
| 2931 | with self.assertRaisesRegex(ValueError, 'badly formed help string') as cm: |
nothing calls this directly
no test coverage detected