(self)
| 2328 | setattr(namespace, self.dest, 'foo[%s]' % values) |
| 2329 | |
| 2330 | def test(self): |
| 2331 | |
| 2332 | parser = argparse.ArgumentParser() |
| 2333 | parser.register('action', 'my_action', self.MyAction) |
| 2334 | parser.add_argument('badger', action='my_action') |
| 2335 | |
| 2336 | self.assertEqual(parser.parse_args(['1']), NS(badger='foo[1]')) |
| 2337 | self.assertEqual(parser.parse_args(['42']), NS(badger='foo[42]')) |
| 2338 | |
| 2339 | |
| 2340 | class TestActionExtend(ParserTestCase): |
nothing calls this directly
no test coverage detected