1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-09 21:34:05 +01:00

#N/A: Split shells module

This commit is contained in:
nvbn
2016-01-23 05:06:22 +03:00
parent 60e19a054a
commit abe287a52b
14 changed files with 624 additions and 594 deletions

21
tests/shells/conftest.py Normal file
View File

@@ -0,0 +1,21 @@
import pytest
@pytest.fixture
def builtins_open(mocker):
return mocker.patch('six.moves.builtins.open')
@pytest.fixture
def isfile(mocker):
return mocker.patch('os.path.isfile', return_value=True)
@pytest.fixture
@pytest.mark.usefixtures('isfile')
def history_lines(mocker):
def aux(lines):
mock = mocker.patch('io.open')
mock.return_value.__enter__ \
.return_value.readlines.return_value = lines
return aux