mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
Test fix
This commit is contained in:
parent
f6826cbcf2
commit
7cc6a2e0d4
@ -1,17 +1,19 @@
|
|||||||
from thefuck.rules.pip_install import match, get_new_command
|
import pytest
|
||||||
from thefuck.types import Command
|
from thefuck.types import Command
|
||||||
|
|
||||||
|
good_output = """community/shared_meataxe 1.0-3
|
||||||
def test_match():
|
|
||||||
right_response = """
|
|
||||||
community/shared_meataxe 1.0-3
|
|
||||||
A set of programs for working with matrix representations over finite fields
|
A set of programs for working with matrix representations over finite fields
|
||||||
"""
|
"""
|
||||||
assert not match(Command('pacman -Ss meat', right_response))
|
|
||||||
|
|
||||||
wrong_response = "error: invalid option '-s'"
|
bad_output = "error: invalid option '-s'"
|
||||||
assert match(Command('pacman -ss meat', wrong_response))
|
|
||||||
|
|
||||||
|
def test_match():
|
||||||
|
assert match(Command('pacman -Ss meat', good_output))
|
||||||
|
assert match(Command('sudo pacman -Ss meat', good_output))
|
||||||
|
|
||||||
def test_get_new_command():
|
def test_get_new_command():
|
||||||
assert get_new_command(Command('pacman -s meat', '')) == 'pacman -S meat'
|
new_command = get_new_command(Command('pacman -ss meat', bad_output))
|
||||||
|
assert new_command == 'pacman -Ss meat'
|
||||||
|
|
||||||
|
new_command = get_new_command(Command('sudo pacman -s meat', bad_output))
|
||||||
|
assert new_command == 'sudo pacman -S meat'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user