コード例 #1
0
ファイル: test_shells.py プロジェクト: nwinkler/thefuck
 def shell(self):
     return shells.Generic()
コード例 #2
0
import pytest
from thefuck import shells
from thefuck import conf, const
from thefuck.system import Path

shells.shell = shells.Generic()


def pytest_addoption(parser):
    """Adds `--enable-functional` argument."""
    group = parser.getgroup("thefuck")
    group.addoption('--enable-functional',
                    action="store_true",
                    default=False,
                    help="Enable functional tests")


@pytest.fixture
def no_memoize(monkeypatch):
    monkeypatch.setattr('thefuck.utils.memoize.disabled', True)


@pytest.fixture(autouse=True)
def settings(request):
    def _reset_settings():
        conf.settings.clear()
        conf.settings.update(const.DEFAULT_SETTINGS)

    request.addfinalizer(_reset_settings)
    conf.settings.user_dir = Path('~/.thefuck')
    return conf.settings
コード例 #3
0
ファイル: test_shells.py プロジェクト: youngdev/thefuck
 def test_to_shell(self):
     assert shells.Generic().to_shell('pwd') == 'pwd'
コード例 #4
0
ファイル: test_shells.py プロジェクト: youngdev/thefuck
 def test_put_to_history(self, builtins_open):
     assert shells.Generic().put_to_history('ls') is None
     assert builtins_open.call_count == 0
コード例 #5
0
ファイル: test_shells.py プロジェクト: youngdev/thefuck
 def test_from_shell(self):
     assert shells.Generic().from_shell('pwd') == 'pwd'