1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-04-17 16:20:49 +01:00
thefuck/tests/rules/test_pacman_invalid_option.py
DragonGhost7 7cc6a2e0d4 Test fix
2019-10-03 22:25:50 -04:00

20 lines
643 B
Python

import pytest
from thefuck.types import Command
good_output = """community/shared_meataxe 1.0-3
A set of programs for working with matrix representations over finite fields
"""
bad_output = "error: invalid option '-s'"
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():
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'