mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-28 08:02:33 +01:00
#682: Unify work with output in classic and instant mode
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
from thefuck.rules.git_push_force import match, get_new_command
|
||||
from tests.utils import Command
|
||||
from thefuck.types import Command
|
||||
|
||||
|
||||
git_err = '''
|
||||
@@ -26,27 +26,27 @@ To /tmp/bar
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command(script='git push', stderr=git_err),
|
||||
Command(script='git push nvbn', stderr=git_err),
|
||||
Command(script='git push nvbn master', stderr=git_err)])
|
||||
Command('git push', git_err),
|
||||
Command('git push nvbn', git_err),
|
||||
Command('git push nvbn master', git_err)])
|
||||
def test_match(command):
|
||||
assert match(command)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command(script='git push', stderr=git_ok),
|
||||
Command(script='git push', stderr=git_uptodate),
|
||||
Command(script='git push nvbn', stderr=git_ok),
|
||||
Command(script='git push nvbn master', stderr=git_uptodate),
|
||||
Command(script='git push nvbn', stderr=git_ok),
|
||||
Command(script='git push nvbn master', stderr=git_uptodate)])
|
||||
Command('git push', git_ok),
|
||||
Command('git push', git_uptodate),
|
||||
Command('git push nvbn', git_ok),
|
||||
Command('git push nvbn master', git_uptodate),
|
||||
Command('git push nvbn', git_ok),
|
||||
Command('git push nvbn master', git_uptodate)])
|
||||
def test_not_match(command):
|
||||
assert not match(command)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, output', [
|
||||
(Command(script='git push', stderr=git_err), 'git push --force-with-lease'),
|
||||
(Command(script='git push nvbn', stderr=git_err), 'git push --force-with-lease nvbn'),
|
||||
(Command(script='git push nvbn master', stderr=git_err), 'git push --force-with-lease nvbn master')])
|
||||
(Command('git push', git_err), 'git push --force-with-lease'),
|
||||
(Command('git push nvbn', git_err), 'git push --force-with-lease nvbn'),
|
||||
(Command('git push nvbn master', git_err), 'git push --force-with-lease nvbn master')])
|
||||
def test_get_new_command(command, output):
|
||||
assert get_new_command(command) == output
|
||||
|
Reference in New Issue
Block a user