

def test_find_alternative_exception_message_multiple(self):
    '\n        Application.find() raises an exception when alternatives have been found\n        '
    application = Application()
    application.add(FooCommand())
    application.add(Foo1Command())
    application.add(Foo2Command())
    try:
        application.find('foo:baR')
        application.fail('.find() raises an Exception if command does not exist, with alternatives')
    except Exception as e:
        self.assertRegexpMatches(str(e), 'Did you mean one of these')
        self.assertRegexpMatches(str(e), 'foo1:bar')
        self.assertRegexpMatches(str(e), 'foo:bar')
    try:
        application.find('foo2:baR')
        self.fail('.find() raises an Exception if command does not exist, with alternatives')
    except Exception as e:
        self.assertRegexpMatches(str(e), 'Did you mean one of these')
        self.assertRegexpMatches(str(e), 'foo1')
    application.add(Foo3Command())
    application.add(Foo4Command())
    try:
        application.find('foo3:')
        self.fail('.find() raises an Exception if command does not exist, with alternatives')
    except Exception as e:
        self.assertRegexpMatches(str(e), 'foo3:bar')
        self.assertRegexpMatches(str(e), 'foo3:bar:toh')

dataset/ETHPy150Open sdispater/cleo/tests/test_application.py ApplicationTest.test_find_alternative_exception_message_multiple/VarMisuse@56/101 `self`->`application`