MCPcopy Index your code
hub / github.com/python/cpython / _test_mutex_ab

Method _test_mutex_ab

Lib/test/test_argparse.py:3179–3187  ·  view source on GitHub ↗
(self, parse_args)

Source from the content-addressed store, hash-verified

3177 self._test_mutex_ab(parser.parse_args)
3178
3179 def _test_mutex_ab(self, parse_args):
3180 self.assertEqual(parse_args([]), NS(a=False, b=False))
3181 self.assertEqual(parse_args(['-a']), NS(a=True, b=False))
3182 self.assertEqual(parse_args(['-b']), NS(a=False, b=True))
3183 self.assertArgumentParserError(parse_args, ['-a', '-b'])
3184 self.assertArgumentParserError(parse_args, ['-b', '-a'])
3185 self.assertArgumentParserError(parse_args, ['-c'])
3186 self.assertArgumentParserError(parse_args, ['-a', '-c'])
3187 self.assertArgumentParserError(parse_args, ['-b', '-c'])
3188
3189 def test_multiple_parents(self):
3190 parents = [self.abcd_parent, self.wxyz_parent]

Callers 2

Calls 4

parse_argsFunction · 0.70
NSClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected