mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 02:01:13 +00:00
Merge pull request #315 from scorphus/fix-tests
Fix git_push_pull and not_match tests
This commit is contained in:
commit
fa234fde70
@ -11,6 +11,14 @@ def test_match(command):
|
||||
assert match(command, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command(script='mv foo bar/', stderr=""),
|
||||
Command(script='mv foo bar/foo', stderr="mv: permission denied"),
|
||||
])
|
||||
def test_not_match(command):
|
||||
assert not match(command, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command(script='mv foo bar/foo', stderr="mv: cannot move 'foo' to 'bar/foo': No such file or directory"), 'mkdir -p bar && mv foo bar/foo'),
|
||||
(Command(script='mv foo bar/', stderr="mv: cannot move 'foo' to 'bar/': No such file or directory"), 'mkdir -p bar && mv foo bar/'),
|
||||
|
@ -1,5 +1,4 @@
|
||||
from thefuck import utils
|
||||
from thefuck.shells import and_
|
||||
from thefuck import utils, shells
|
||||
from thefuck.utils import replace_argument
|
||||
|
||||
|
||||
@ -13,5 +12,5 @@ def match(command, settings):
|
||||
|
||||
@utils.git_support
|
||||
def get_new_command(command, settings):
|
||||
return and_(replace_argument(command.script, 'push', 'pull'),
|
||||
return shells.and_(replace_argument(command.script, 'push', 'pull'),
|
||||
command.script)
|
||||
|
Loading…
x
Reference in New Issue
Block a user