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

Method test_dest

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

Source from the content-addressed store, hash-verified

2733 (NS(known=1, new=1), ['-e-w']))
2734
2735 def test_dest(self):
2736 parser = ErrorRaisingArgumentParser()
2737 parser.add_argument('--foo', action='store_true')
2738 subparsers = parser.add_subparsers(dest='bar')
2739 parser1 = subparsers.add_parser('1')
2740 parser1.add_argument('baz')
2741 self.assertEqual(NS(foo=False, bar='1', baz='2'),
2742 parser.parse_args('1 2'.split()))
2743
2744 def _test_required_subparsers(self, parser):
2745 # 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