MCPcopy Index your code
hub / github.com/RustPython/RustPython / _test_mutex_ab

Method _test_mutex_ab

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

Source from the content-addressed store, hash-verified

3066 self._test_mutex_ab(parser.parse_args)
3067
3068 def _test_mutex_ab(self, parse_args):
3069 self.assertEqual(parse_args([]), NS(a=False, b=False))
3070 self.assertEqual(parse_args(['-a']), NS(a=True, b=False))
3071 self.assertEqual(parse_args(['-b']), NS(a=False, b=True))
3072 self.assertArgumentParserError(parse_args, ['-a', '-b'])
3073 self.assertArgumentParserError(parse_args, ['-b', '-a'])
3074 self.assertArgumentParserError(parse_args, ['-c'])
3075 self.assertArgumentParserError(parse_args, ['-a', '-c'])
3076 self.assertArgumentParserError(parse_args, ['-b', '-c'])
3077
3078 def test_multiple_parents(self):
3079 parents = [self.abcd_parent, self.wxyz_parent]

Callers 2

Calls 4

NSClass · 0.70
parse_argsFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected