1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-31 07:04:12 +00:00

Merge pull request #306 from mcarton/hub

Support GitHub's hub command
This commit is contained in:
Vladimir Iakovlev
2015-07-21 16:43:24 +03:00
15 changed files with 39 additions and 27 deletions

View File

@@ -20,5 +20,5 @@ def test_match(stderr):
def test_get_new_command(stderr):
assert get_new_command(Command(stderr=stderr), None)\
assert get_new_command(Command('git push', stderr=stderr), None)\
== "git push --set-upstream origin master"

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)