1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-31 07:04:12 +00:00

Merge pull request #352 from mcarton/slow

Fix slowness problems II
This commit is contained in:
Vladimir Iakovlev
2015-09-02 09:36:48 +03:00
20 changed files with 117 additions and 125 deletions

View File

@@ -1,6 +1,6 @@
import pytest
from thefuck.rules.brew_install import match, get_new_command
from thefuck.rules.brew_install import brew_formulas
from thefuck.rules.brew_install import _get_formulas
from tests.utils import Command
@@ -20,9 +20,7 @@ def brew_already_installed():
def _is_not_okay_to_test():
if 'elasticsearch' not in brew_formulas:
return True
return False
return 'elasticsearch' not in _get_formulas()
@pytest.mark.skipif(_is_not_okay_to_test(),

View File

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