(self)
| 3244 | raises(ValueError, add_argument, 'bar', nargs=argparse.PARSER) |
| 3245 | |
| 3246 | def test_help(self): |
| 3247 | parser = ErrorRaisingArgumentParser(prog='PROG') |
| 3248 | group1 = parser.add_mutually_exclusive_group() |
| 3249 | group1.add_argument('--foo', action='store_true') |
| 3250 | group1.add_argument('--bar', action='store_false') |
| 3251 | group2 = parser.add_mutually_exclusive_group() |
| 3252 | group2.add_argument('--soup', action='store_true') |
| 3253 | group2.add_argument('--nuts', action='store_false') |
| 3254 | expected = '''\ |
| 3255 | usage: PROG [-h] [--foo | --bar] [--soup | --nuts] |
| 3256 | |
| 3257 | options: |
| 3258 | -h, --help show this help message and exit |
| 3259 | --foo |
| 3260 | --bar |
| 3261 | --soup |
| 3262 | --nuts |
| 3263 | ''' |
| 3264 | self.assertEqual(parser.format_help(), textwrap.dedent(expected)) |
| 3265 | |
| 3266 | def test_optional_order(self): |
| 3267 | parser = ErrorRaisingArgumentParser(prog='PROG') |
nothing calls this directly
no test coverage detected