mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-29 22:24:44 +00:00
#682: Unify work with output in classic and instant mode
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import pytest
|
||||
|
||||
from tests.utils import Command
|
||||
from thefuck.types import Command
|
||||
from thefuck.rules.tsuru_not_command import match, get_new_command
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command('tsuru log', stderr=(
|
||||
Command('tsuru log', (
|
||||
'tsuru: "tchururu" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
'\tapp-log\n'
|
||||
'\tlogin\n'
|
||||
'\tlogout\n'
|
||||
)),
|
||||
Command('tsuru app-l', stderr=(
|
||||
Command('tsuru app-l', (
|
||||
'tsuru: "tchururu" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
'\tapp-list\n'
|
||||
'\tapp-log\n'
|
||||
)),
|
||||
Command('tsuru user-list', stderr=(
|
||||
Command('tsuru user-list', (
|
||||
'tsuru: "tchururu" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
'\tteam-user-list\n'
|
||||
)),
|
||||
Command('tsuru targetlist', stderr=(
|
||||
Command('tsuru targetlist', (
|
||||
'tsuru: "tchururu" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
'\ttarget-list\n'
|
||||
@@ -34,16 +34,16 @@ def test_match(command):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command('tsuru tchururu', stderr=(
|
||||
Command('tsuru tchururu', (
|
||||
'tsuru: "tchururu" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
)),
|
||||
Command('tsuru version', stderr='tsuru version 0.16.0.'),
|
||||
Command('tsuru help', stderr=(
|
||||
Command('tsuru version', 'tsuru version 0.16.0.'),
|
||||
Command('tsuru help', (
|
||||
'tsuru version 0.16.0.\n'
|
||||
'\nUsage: tsuru command [args]\n'
|
||||
)),
|
||||
Command('tsuru platform-list', stderr=(
|
||||
Command('tsuru platform-list', (
|
||||
'- java\n'
|
||||
'- logstashgiro\n'
|
||||
'- newnode\n'
|
||||
@@ -55,32 +55,32 @@ def test_match(command):
|
||||
'- ruby20\n'
|
||||
'- static\n'
|
||||
)),
|
||||
Command('tsuru env-get', stderr='Error: App thefuck not found.'),
|
||||
Command('tsuru env-get', 'Error: App thefuck not found.'),
|
||||
])
|
||||
def test_not_match(command):
|
||||
assert not match(command)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_commands', [
|
||||
(Command('tsuru log', stderr=(
|
||||
(Command('tsuru log', (
|
||||
'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 logout', 'tsuru app-log']),
|
||||
(Command('tsuru app-l', stderr=(
|
||||
(Command('tsuru app-l', (
|
||||
'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-list']),
|
||||
(Command('tsuru user-list', stderr=(
|
||||
(Command('tsuru user-list', (
|
||||
'tsuru: "user-list" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
'\tteam-user-list\n'
|
||||
)), ['tsuru team-user-list']),
|
||||
(Command('tsuru targetlist', stderr=(
|
||||
(Command('tsuru targetlist', (
|
||||
'tsuru: "targetlist" is not a tsuru command. See "tsuru help".\n'
|
||||
'\nDid you mean?\n'
|
||||
'\ttarget-list\n'
|
||||
|
||||
Reference in New Issue
Block a user