

def test_has_get(self):
    '\n        Application.has() and Application.get() should determine and get commands\n        '
    application = Application()
    self.assertTrue(application.has('list'), msg='.has() returns true if a command is registered')
    self.assertFalse(application.has('afoobar'), msg='.has() returns false if a command is not registered')
    foo = FooCommand()
    application.add(foo)
    self.assertTrue(application.has('afoobar'), msg='.has() returns true if an alias is registered')
    self.assertEqual(foo, application.get('foo:bar'), msg='.get() returns a command by name')
    self.assertEqual(foo, application.get('afoobar'), msg='.get() returns a command by alias')
    application = Application()
    application.add(foo)
    application._want_helps = True
    application.assertTrue(isinstance(application.get('foo:bar'), HelpCommand), msg='.get() returns the help command if --help is provided as the input')

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