mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 12:58:33 +00:00
Fix tests
Thanks to [scorphus] for his [help]. [scorphus]: https://github.com/scorphus [help]: https://github.com/nvbn/thefuck/pull/352#issuecomment-135248982
This commit is contained in:
parent
514bb7df81
commit
27c14a44af
@ -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),
|
assert get_new_command(Command('brew inst', stderr=brew_unknown_cmd),
|
||||||
None) == ['brew list', 'brew install', 'brew uninstall']
|
None) == ['brew list', 'brew install', 'brew uninstall']
|
||||||
|
|
||||||
assert get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2),
|
cmds = get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2), None)
|
||||||
None) == ['brew install', 'brew uninstall', 'brew list']
|
assert 'brew install' in cmds
|
||||||
|
assert 'brew uninstall' in cmds
|
||||||
|
@ -95,7 +95,7 @@ def get_all_executables():
|
|||||||
tf_alias = thefuck_alias()
|
tf_alias = thefuck_alias()
|
||||||
return [exe.name
|
return [exe.name
|
||||||
for path in os.environ.get('PATH', '').split(':')
|
for path in os.environ.get('PATH', '').split(':')
|
||||||
for exe in _safe(Path(path).iterdir, [])
|
for exe in _safe(lambda: list(Path(path).iterdir()), [])
|
||||||
if not _safe(exe.is_dir, True)] + [
|
if not _safe(exe.is_dir, True)] + [
|
||||||
alias for alias in get_aliases() if alias != tf_alias]
|
alias for alias in get_aliases() if alias != tf_alias]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user