

def test_command_decorator(self):
    '\n        @Application.command decorator should register a command\n        '
    application = Application()

    @application.command('decorated_foo', description='Foo')
    def decorated_foo_code(i, o):
        o.writeln('called')
    self.assertTrue(application.has('decorated_foo'))
    command = application.get('decorated_foo')
    self.assertEqual(command._code, decorated_foo_code)
    application.assertEqual(command.get_description(), 'Foo')
    self.assertTrue(('decorated_foo_code' in command.get_aliases()))

dataset/ETHPy150Open sdispater/cleo/tests/test_application.py ApplicationTest.test_command_decorator/VarMisuse@81/134 `self`->`application`