1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-09 21:34:05 +01:00

#298 Suggest more than one result in *_no_command rules

This commit is contained in:
nvbn
2015-07-29 16:09:26 +03:00
parent 4bc1cc7849
commit d6e80b7835
17 changed files with 53 additions and 56 deletions

View File

@@ -61,30 +61,30 @@ def test_not_match(command):
assert not match(command, None)
@pytest.mark.parametrize('command, new_command', [
@pytest.mark.parametrize('command, new_commands', [
(Command('tsuru log', stderr=(
'tsuru: "log" is not a tsuru command. See "tsuru help".\n'
'\nDid you mean?\n'
'\tapp-log\n'
'\tlogin\n'
'\tlogout\n'
)), 'tsuru login'),
)), ['tsuru login', 'tsuru logout', 'tsuru app-log']),
(Command('tsuru app-l', stderr=(
'tsuru: "app-l" is not a tsuru command. See "tsuru help".\n'
'\nDid you mean?\n'
'\tapp-list\n'
'\tapp-log\n'
)), 'tsuru app-log'),
)), ['tsuru app-log', 'tsuru app-list']),
(Command('tsuru user-list', stderr=(
'tsuru: "user-list" is not a tsuru command. See "tsuru help".\n'
'\nDid you mean?\n'
'\tteam-user-list\n'
)), 'tsuru team-user-list'),
)), ['tsuru team-user-list']),
(Command('tsuru targetlist', stderr=(
'tsuru: "targetlist" is not a tsuru command. See "tsuru help".\n'
'\nDid you mean?\n'
'\ttarget-list\n'
)), 'tsuru target-list'),
)), ['tsuru target-list']),
])
def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command
def test_get_new_command(command, new_commands):
assert get_new_command(command, None) == new_commands