

def test_argument_decorator(self):
    '\n        @Application.argument decorator should register a command with a specific argument\n        '
    application = Application()

    @application.argument('foo', description='Foo', required=True, is_list=True)
    def decorated_foo_code(i, o):
        'Foo Description'
        o.writeln('called')
    self.assertTrue(application.has('decorated_foo_code'))
    command = application.get('decorated_foo_code')
    self.assertEqual(command._code, decorated_foo_code)
    self.assertEqual(command.get_description(), 'Foo Description')
    argument = command.get_definition().get_argument('foo')
    self.assertEqual('Foo', argument.get_description())
    argument.assertTrue(argument.is_required())
    self.assertTrue(argument.is_list())

dataset/ETHPy150Open sdispater/cleo/tests/test_application.py ApplicationTest.test_argument_decorator/VarMisuse@130/211 `self`->`argument`