mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-01 09:32:32 +01:00
#682: Unify work with output in classic and instant mode
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
import pytest
|
||||
|
||||
from tests.utils import Command
|
||||
from thefuck.types import Command
|
||||
from thefuck.rules.mercurial import (
|
||||
extract_possibilities, match, get_new_command
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command('hg base', stderr=(
|
||||
Command('hg base', (
|
||||
"hg: unknown command 'base'"
|
||||
'\n(did you mean one of blame, phase, rebase?)'
|
||||
)),
|
||||
Command('hg branchch', stderr=(
|
||||
Command('hg branchch', (
|
||||
"hg: unknown command 'branchch'"
|
||||
'\n(did you mean one of branch, branches?)'
|
||||
)),
|
||||
Command('hg vert', stderr=(
|
||||
Command('hg vert', (
|
||||
"hg: unknown command 'vert'"
|
||||
'\n(did you mean one of revert?)'
|
||||
)),
|
||||
Command('hg lgo -r tip', stderr=(
|
||||
Command('hg lgo -r tip', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n(did you mean one of log?)'
|
||||
)),
|
||||
Command('hg rerere', stderr=(
|
||||
Command('hg rerere', (
|
||||
"hg: unknown command 'rerere'"
|
||||
'\n(did you mean one of revert?)'
|
||||
)),
|
||||
Command('hg re', stderr=(
|
||||
Command('hg re', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n rebase recover remove rename resolve revert'
|
||||
)),
|
||||
Command('hg re re', stderr=(
|
||||
Command('hg re re', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n rebase recover remove rename resolve revert'
|
||||
)),
|
||||
@@ -41,24 +41,24 @@ def test_match(command):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command('hg', stderr=(
|
||||
Command('hg', (
|
||||
'\nMercurial Distributed SCM\n\nbasic commands:'
|
||||
)),
|
||||
Command('hg asdf', stderr=(
|
||||
Command('hg asdf', (
|
||||
"hg: unknown command 'asdf'"
|
||||
'\nMercurial Distributed SCM\n\nbasic commands:'
|
||||
)),
|
||||
Command('hg qwer', stderr=(
|
||||
Command('hg qwer', (
|
||||
"hg: unknown command 'qwer'"
|
||||
'\nMercurial Distributed SCM\n\nbasic commands:'
|
||||
)),
|
||||
Command('hg me', stderr=(
|
||||
Command('hg me', (
|
||||
"\nabort: no repository found in './thefuck' (.hg not found)!"
|
||||
)),
|
||||
Command('hg reb', stderr=(
|
||||
Command('hg reb', (
|
||||
"\nabort: no repository found in './thefuck' (.hg not found)!"
|
||||
)),
|
||||
Command('hg co', stderr=(
|
||||
Command('hg co', (
|
||||
"\nabort: no repository found in './thefuck' (.hg not found)!"
|
||||
)),
|
||||
])
|
||||
@@ -67,31 +67,31 @@ def test_not_match(command):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, possibilities', [
|
||||
(Command('hg base', stderr=(
|
||||
(Command('hg base', (
|
||||
"hg: unknown command 'base'"
|
||||
'\n(did you mean one of blame, phase, rebase?)'
|
||||
)), ['blame', 'phase', 'rebase']),
|
||||
(Command('hg branchch', stderr=(
|
||||
(Command('hg branchch', (
|
||||
"hg: unknown command 'branchch'"
|
||||
'\n(did you mean one of branch, branches?)'
|
||||
)), ['branch', 'branches']),
|
||||
(Command('hg vert', stderr=(
|
||||
(Command('hg vert', (
|
||||
"hg: unknown command 'vert'"
|
||||
'\n(did you mean one of revert?)'
|
||||
)), ['revert']),
|
||||
(Command('hg lgo -r tip', stderr=(
|
||||
(Command('hg lgo -r tip', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n(did you mean one of log?)'
|
||||
)), ['log']),
|
||||
(Command('hg rerere', stderr=(
|
||||
(Command('hg rerere', (
|
||||
"hg: unknown command 'rerere'"
|
||||
'\n(did you mean one of revert?)'
|
||||
)), ['revert']),
|
||||
(Command('hg re', stderr=(
|
||||
(Command('hg re', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n rebase recover remove rename resolve revert'
|
||||
)), ['rebase', 'recover', 'remove', 'rename', 'resolve', 'revert']),
|
||||
(Command('hg re re', stderr=(
|
||||
(Command('hg re re', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n rebase recover remove rename resolve revert'
|
||||
)), ['rebase', 'recover', 'remove', 'rename', 'resolve', 'revert']),
|
||||
@@ -101,31 +101,31 @@ def test_extract_possibilities(command, possibilities):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command('hg base', stderr=(
|
||||
(Command('hg base', (
|
||||
"hg: unknown command 'base'"
|
||||
'\n(did you mean one of blame, phase, rebase?)'
|
||||
)), 'hg rebase'),
|
||||
(Command('hg branchch', stderr=(
|
||||
(Command('hg branchch', (
|
||||
"hg: unknown command 'branchch'"
|
||||
'\n(did you mean one of branch, branches?)'
|
||||
)), 'hg branch'),
|
||||
(Command('hg vert', stderr=(
|
||||
(Command('hg vert', (
|
||||
"hg: unknown command 'vert'"
|
||||
'\n(did you mean one of revert?)'
|
||||
)), 'hg revert'),
|
||||
(Command('hg lgo -r tip', stderr=(
|
||||
(Command('hg lgo -r tip', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n(did you mean one of log?)'
|
||||
)), 'hg log -r tip'),
|
||||
(Command('hg rerere', stderr=(
|
||||
(Command('hg rerere', (
|
||||
"hg: unknown command 'rerere'"
|
||||
'\n(did you mean one of revert?)'
|
||||
)), 'hg revert'),
|
||||
(Command('hg re', stderr=(
|
||||
(Command('hg re', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n rebase recover remove rename resolve revert'
|
||||
)), 'hg rebase'),
|
||||
(Command('hg re re', stderr=(
|
||||
(Command('hg re re', (
|
||||
"hg: command 're' is ambiguous:"
|
||||
'\n rebase recover remove rename resolve revert'
|
||||
)), 'hg rebase re'),
|
||||
|
Reference in New Issue
Block a user