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

Method test_dest

Lib/test/test_argparse.py:2634–2641  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2632 (NS(known=1, new=1), ['-e-w']))
2633
2634 def test_dest(self):
2635 parser = ErrorRaisingArgumentParser()
2636 parser.add_argument('--foo', action='store_true')
2637 subparsers = parser.add_subparsers(dest='bar')
2638 parser1 = subparsers.add_parser('1')
2639 parser1.add_argument('baz')
2640 self.assertEqual(NS(foo=False, bar='1', baz='2'),
2641 parser.parse_args('1 2'.split()))
2642
2643 def _test_required_subparsers(self, parser):
2644 # Should parse the sub command

Callers

nothing calls this directly

Calls 8

parse_argsMethod · 0.95
add_subparsersMethod · 0.80
add_parserMethod · 0.80
NSClass · 0.70
add_argumentMethod · 0.45
assertEqualMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected