mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-19 11:42:33 +01:00
Start support for git aliases
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
from mock import Mock
|
||||
from thefuck.utils import sudo_support, wrap_settings, memoize, get_closest
|
||||
from thefuck.utils import git_support, sudo_support, wrap_settings, memoize, get_closest
|
||||
from thefuck.types import Settings
|
||||
from tests.utils import Command
|
||||
|
||||
@@ -26,6 +26,15 @@ def test_sudo_support(return_value, command, called, result):
|
||||
fn.assert_called_once_with(Command(called), None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('called, command, stderr', [
|
||||
('git co', "git 'checkout'", "19:22:36.299340 git.c:282 trace: alias expansion: co => 'checkout'"),
|
||||
('git com file', "git 'commit' '--verbose' file", "19:23:25.470911 git.c:282 trace: alias expansion: com => 'commit' '--verbose'")])
|
||||
def test_git_support(called, command, stderr):
|
||||
@git_support
|
||||
def fn(command, settings): return command.script
|
||||
assert fn(Command(script=called, stderr=stderr), None) == command
|
||||
|
||||
|
||||
def test_memoize():
|
||||
fn = Mock(__name__='fn')
|
||||
memoized = memoize(fn)
|
||||
|
Reference in New Issue
Block a user