(self)
| 3355 | raises(ValueError, add_argument, 'bar', nargs=argparse.PARSER) |
| 3356 | |
| 3357 | def test_help(self): |
| 3358 | parser = ErrorRaisingArgumentParser(prog='PROG') |
| 3359 | group1 = parser.add_mutually_exclusive_group() |
| 3360 | group1.add_argument('--foo', action='store_true') |
| 3361 | group1.add_argument('--bar', action='store_false') |
| 3362 | group2 = parser.add_mutually_exclusive_group() |
| 3363 | group2.add_argument('--soup', action='store_true') |
| 3364 | group2.add_argument('--nuts', action='store_false') |
| 3365 | expected = '''\ |
| 3366 | usage: PROG [-h] [--foo | --bar] [--soup | --nuts] |
| 3367 | |
| 3368 | options: |
| 3369 | -h, --help show this help message and exit |
| 3370 | --foo |
| 3371 | --bar |
| 3372 | --soup |
| 3373 | --nuts |
| 3374 | ''' |
| 3375 | self.assertEqual(parser.format_help(), textwrap.dedent(expected)) |
| 3376 | |
| 3377 | def test_optional_order(self): |
| 3378 | parser = ErrorRaisingArgumentParser(prog='PROG') |
nothing calls this directly
no test coverage detected