mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-07 20:34:02 +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_not_command import match, get_new_command
|
||||
from tests.utils import Command
|
||||
from thefuck.types import Command
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -41,17 +41,17 @@ def git_command():
|
||||
|
||||
|
||||
def test_match(git_not_command, git_command, git_not_command_one_of_this):
|
||||
assert match(Command('git brnch', stderr=git_not_command))
|
||||
assert match(Command('git st', stderr=git_not_command_one_of_this))
|
||||
assert not match(Command('ls brnch', stderr=git_not_command))
|
||||
assert not match(Command('git branch', stderr=git_command))
|
||||
assert match(Command('git brnch', git_not_command))
|
||||
assert match(Command('git st', git_not_command_one_of_this))
|
||||
assert not match(Command('ls brnch', git_not_command))
|
||||
assert not match(Command('git branch', git_command))
|
||||
|
||||
|
||||
def test_get_new_command(git_not_command, git_not_command_one_of_this,
|
||||
git_not_command_closest):
|
||||
assert (get_new_command(Command('git brnch', stderr=git_not_command))
|
||||
assert (get_new_command(Command('git brnch', git_not_command))
|
||||
== ['git branch'])
|
||||
assert (get_new_command(Command('git st', stderr=git_not_command_one_of_this))
|
||||
assert (get_new_command(Command('git st', git_not_command_one_of_this))
|
||||
== ['git stats', 'git stash', 'git stage'])
|
||||
assert (get_new_command(Command('git tags', stderr=git_not_command_closest))
|
||||
assert (get_new_command(Command('git tags', git_not_command_closest))
|
||||
== ['git tag', 'git stage'])
|
||||
|
Reference in New Issue
Block a user