1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-19 03:32:31 +01:00

#N/A Add replace_argument helper

This commit is contained in:
nvbn
2015-07-24 00:39:56 +03:00
parent f9f0948349
commit 469c5a60b0
19 changed files with 61 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
import pytest
from mock import Mock
from thefuck.utils import git_support, sudo_support, wrap_settings,\
memoize, get_closest, get_all_executables
memoize, get_closest, get_all_executables, replace_argument
from thefuck.types import Settings
from tests.utils import Command
@@ -92,3 +92,10 @@ def test_get_all_callables():
assert 'vim' in all_callables
assert 'fsck' in all_callables
assert 'fuck' not in all_callables
@pytest.mark.parametrize('args, result', [
(('apt-get instol vim', 'instol', 'install'), 'apt-get install vim'),
(('git brnch', 'brnch', 'branch'), 'git branch')])
def test_replace_argument(args, result):
assert replace_argument(*args) == result