#N/A Move get_all_executables (formerly get_all_callables) to utils

This commit is contained in:
nvbn
2015-07-20 21:04:49 +03:00
parent c67560864a
commit dee018e792
6 changed files with 48 additions and 48 deletions
+16 -1
View File
@@ -1,6 +1,7 @@
import pytest
from mock import Mock
from thefuck.utils import git_support, sudo_support, wrap_settings, memoize, get_closest
from thefuck.utils import git_support, sudo_support, wrap_settings,\
memoize, get_closest, get_all_executables
from thefuck.types import Settings
from tests.utils import Command
@@ -63,3 +64,17 @@ class TestGetClosest(object):
def test_without_fallback(self):
assert get_closest('st', ['status', 'reset'],
fallback_to_first=False) is None
@pytest.fixture
def get_aliases(mocker):
mocker.patch('thefuck.shells.get_aliases',
return_value=['vim', 'apt-get', 'fsck', 'fuck'])
@pytest.mark.usefixtures('no_memoize', 'get_aliases')
def test_get_all_callables():
all_callables = get_all_executables()
assert 'vim' in all_callables
assert 'fsck' in all_callables
assert 'fuck' not in all_callables