1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-28 08:02:33 +01:00

#682: Unify work with output in classic and instant mode

This commit is contained in:
Vladimir Iakovlev
2017-08-31 17:58:56 +02:00
parent 96843fc6cd
commit 4625d8503d
237 changed files with 1322 additions and 1332 deletions

View File

@@ -1,7 +1,7 @@
import pytest
from thefuck.rules.brew_unknown_command import match, get_new_command
from thefuck.rules.brew_unknown_command import _brew_commands
from tests.utils import Command
from thefuck.types import Command
@pytest.fixture
@@ -15,15 +15,15 @@ def brew_unknown_cmd2():
def test_match(brew_unknown_cmd):
assert match(Command('brew inst', stderr=brew_unknown_cmd))
assert match(Command('brew inst', brew_unknown_cmd))
for command in _brew_commands():
assert not match(Command('brew ' + command))
assert not match(Command('brew ' + command, ''))
def test_get_new_command(brew_unknown_cmd, brew_unknown_cmd2):
assert (get_new_command(Command('brew inst', stderr=brew_unknown_cmd))
assert (get_new_command(Command('brew inst', brew_unknown_cmd))
== ['brew list', 'brew install', 'brew uninstall'])
cmds = get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2))
cmds = get_new_command(Command('brew instaa', brew_unknown_cmd2))
assert 'brew install' in cmds
assert 'brew uninstall' in cmds