1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-07 13:41:21 +00:00
thefuck/tests/rules/test_switch_lang.py

29 lines
937 B
Python
Raw Normal View History

2015-04-21 06:26:15 +02:00
# -*- encoding: utf-8 -*-
import pytest
2015-04-21 06:26:15 +02:00
from thefuck.rules import switch_lang
from thefuck.types import Command
2015-04-21 06:26:15 +02:00
@pytest.mark.parametrize('command', [
Command(u'фзе-пуе', 'command not found: фзе-пуе'),
Command(u'λσ', 'command not found: λσ')])
def test_match(command):
assert switch_lang.match(command)
2015-04-21 22:09:48 +02:00
2015-04-21 06:26:15 +02:00
@pytest.mark.parametrize('command', [
Command(u'pat-get', 'command not found: pat-get'),
Command(u'ls', 'command not found: ls'),
Command(u'агсл', 'command not found: агсл'),
Command(u'фзе-пуе', 'some info')])
def test_not_match(command):
assert not switch_lang.match(command)
2015-04-21 06:26:15 +02:00
@pytest.mark.parametrize('command, new_command', [
(Command(u'фзе-пуе штыефдд мшь', ''), 'apt-get install vim'),
(Command(u'λσ -λα', ''), 'ls -la')])
def test_get_new_command(command, new_command):
assert switch_lang.get_new_command(command) == new_command