1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-30 22:54:14 +00:00

#402: Don't invoke zsh for getting aliases

This commit is contained in:
nvbn
2016-03-01 01:21:51 +03:00
parent 46f2351907
commit f7f0660114
2 changed files with 16 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
import pytest
from thefuck.shells.zsh import Zsh
@@ -11,14 +12,12 @@ class TestZsh(object):
return Zsh()
@pytest.fixture(autouse=True)
def Popen(self, mocker):
mock = mocker.patch('thefuck.shells.zsh.Popen')
mock.return_value.stdout.read.return_value = (
b'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n'
b'l=\'ls -CF\'\n'
b'la=\'ls -A\'\n'
b'll=\'ls -alF\'')
return mock
def shell_aliases(self):
os.environ['TF_SHELL_ALIASES'] = (
'fuck=\'eval $(thefuck $(fc -ln -1 | tail -n 1))\'\n'
'l=\'ls -CF\'\n'
'la=\'ls -A\'\n'
'll=\'ls -alF\'')
@pytest.mark.parametrize('before, after', [
('fuck', 'eval $(thefuck $(fc -ln -1 | tail -n 1))'),