(self)
| 3229 | NS(a='3', b='1', d='2', e='4')) |
| 3230 | |
| 3231 | def test_subparser_parents_mutex(self): |
| 3232 | parser = ErrorRaisingArgumentParser() |
| 3233 | subparsers = parser.add_subparsers() |
| 3234 | parents = [self.ab_mutex_parent] |
| 3235 | abc_parser = subparsers.add_parser('foo', parents=parents) |
| 3236 | c_group = abc_parser.add_argument_group('c_group') |
| 3237 | c_group.add_argument('c') |
| 3238 | parents = [self.wxyz_parent, self.ab_mutex_parent] |
| 3239 | wxyzabe_parser = subparsers.add_parser('bar', parents=parents) |
| 3240 | wxyzabe_parser.add_argument('e') |
| 3241 | self.assertEqual(parser.parse_args('foo -a 4'.split()), |
| 3242 | NS(a=True, b=False, c='4')) |
| 3243 | self.assertEqual(parser.parse_args('bar -b --w 2 3 4'.split()), |
| 3244 | NS(a=False, b=True, w='2', y=None, z='3', e='4')) |
| 3245 | self.assertArgumentParserError( |
| 3246 | parser.parse_args, 'foo -a -b 4'.split()) |
| 3247 | self.assertArgumentParserError( |
| 3248 | parser.parse_args, 'bar -b -a 4'.split()) |
| 3249 | |
| 3250 | def test_parent_help(self): |
| 3251 | parents = [self.abcd_parent, self.wxyz_parent] |
nothing calls this directly
no test coverage detected