예제 #1
0
파일: test_app.py 프로젝트: mmariani/cliff
def test_fuzzy_common_prefix():
    # searched string is a prefix of all commands
    cmd_mgr = CommandManager('cliff.fuzzy')
    app = App('test', '1.0', cmd_mgr)
    cmd_mgr.commands = {}
    cmd_mgr.add_command('user list', utils.TestCommand)
    cmd_mgr.add_command('user show', utils.TestCommand)
    matches = app.get_fuzzy_matches('user')
    assert matches == ['user list', 'user show']
예제 #2
0
def test_fuzzy_common_prefix():
    # searched string is a prefix of all commands
    cmd_mgr = CommandManager('cliff.fuzzy')
    app = App('test', '1.0', cmd_mgr)
    cmd_mgr.commands = {}
    cmd_mgr.add_command('user list', utils.TestCommand)
    cmd_mgr.add_command('user show', utils.TestCommand)
    matches = app.get_fuzzy_matches('user')
    assert matches == ['user list', 'user show']
예제 #3
0
파일: test_app.py 프로젝트: mmariani/cliff
def test_fuzzy_no_commands():
    cmd_mgr = CommandManager('cliff.fuzzy')
    app = App('test', '1.0', cmd_mgr)
    cmd_mgr.commands = {}
    matches = app.get_fuzzy_matches('foo')
    assert matches == []
예제 #4
0
def test_fuzzy_no_commands():
    cmd_mgr = CommandManager('cliff.fuzzy')
    app = App('test', '1.0', cmd_mgr)
    cmd_mgr.commands = {}
    matches = app.get_fuzzy_matches('foo')
    assert matches == []