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

Method test

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

Source from the content-addressed store, hash-verified

2229 setattr(namespace, self.dest, 'foo[%s]' % values)
2230
2231 def test(self):
2232
2233 parser = argparse.ArgumentParser()
2234 parser.register('action', 'my_action', self.MyAction)
2235 parser.add_argument('badger', action='my_action')
2236
2237 self.assertEqual(parser.parse_args(['1']), NS(badger='foo[1]'))
2238 self.assertEqual(parser.parse_args(['42']), NS(badger='foo[42]'))
2239
2240
2241class TestActionExtend(ParserTestCase):

Callers

nothing calls this directly

Calls 5

parse_argsMethod · 0.95
NSClass · 0.70
registerMethod · 0.45
add_argumentMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected