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

Support hub as well as git in @git_support

This commit is contained in:
mcarton
2015-07-21 15:06:04 +02:00
parent 66e2ec7e3f
commit 903abff77e
3 changed files with 26 additions and 4 deletions

View File

@@ -36,6 +36,20 @@ def test_git_support(called, command, stderr):
assert fn(Command(script=called, stderr=stderr), None) == command
@pytest.mark.parametrize('command, is_git', [
('git pull', True),
('hub pull', True),
('git push --set-upstream origin foo', True),
('hub push --set-upstream origin foo', True),
('ls', False),
('cat git', False),
('cat hub', False)])
def test_git_support_match(command, is_git):
@git_support
def fn(command, settings): return True
assert fn(Command(script=command), None) == is_git
def test_memoize():
fn = Mock(__name__='fn')
memoized = memoize(fn)