2016-09-29 10:44:17 +01:00
|
|
|
import pytest
|
2016-09-29 21:41:50 +01:00
|
|
|
from thefuck.rules.remove_trailing_cedilla import match, get_new_command, CEDILLA
|
2017-08-31 17:58:56 +02:00
|
|
|
from thefuck.types import Command
|
2016-09-29 10:44:17 +01:00
|
|
|
|
2016-10-02 17:19:33 +02:00
|
|
|
|
2016-09-29 10:44:17 +01:00
|
|
|
@pytest.mark.parametrize('command', [
|
2017-08-31 17:58:56 +02:00
|
|
|
Command('wrong' + CEDILLA, ''),
|
|
|
|
Command('wrong with args' + CEDILLA, '')])
|
2016-09-29 10:44:17 +01:00
|
|
|
def test_match(command):
|
|
|
|
assert match(command)
|
|
|
|
|
2016-10-02 17:19:33 +02:00
|
|
|
|
2016-09-29 10:44:17 +01:00
|
|
|
@pytest.mark.parametrize('command, new_command', [
|
2017-08-31 17:58:56 +02:00
|
|
|
(Command('wrong' + CEDILLA, ''), 'wrong'),
|
|
|
|
(Command('wrong with args' + CEDILLA, ''), 'wrong with args')])
|
2016-09-29 10:44:17 +01:00
|
|
|
def test_get_new_command(command, new_command):
|
|
|
|
assert get_new_command(command) == new_command
|