1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-19 00:58:56 +00:00

Added tests for hebrew layout.

This commit is contained in:
Omer Katz 2018-01-25 19:41:28 +02:00 committed by GitHub
parent 917682b35a
commit d8c7034a0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,9 @@ from thefuck.types import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(u'фзе-пуе', 'command not found: фзе-пуе'), Command(u'фзе-пуе', 'command not found: фзе-пуе'),
Command(u'λσ', 'command not found: λσ')]) Command(u'λσ', 'command not found: λσ'),
Command(u'שפא-עקא', 'command not found: שפא-עקא'),
Command(u'ךד', 'command not found: ךד'),])
def test_match(command): def test_match(command):
assert switch_lang.match(command) assert switch_lang.match(command)
@ -16,13 +18,16 @@ def test_match(command):
Command(u'pat-get', 'command not found: pat-get'), Command(u'pat-get', 'command not found: pat-get'),
Command(u'ls', 'command not found: ls'), Command(u'ls', 'command not found: ls'),
Command(u'агсл', 'command not found: агсл'), Command(u'агсл', 'command not found: агсл'),
Command(u'фзе-пуе', 'some info')]) Command(u'фзе-пуе', 'some info'),
Command(u'שפא-עקא', 'some info')])
def test_not_match(command): def test_not_match(command):
assert not switch_lang.match(command) assert not switch_lang.match(command)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command(u'фзе-пуе штыефдд мшь', ''), 'apt-get install vim'), (Command(u'фзе-пуе штыефдд мшь', ''), 'apt-get install vim'),
(Command(u'λσ -λα', ''), 'ls -la')]) (Command(u'λσ -λα', ''), 'ls -la'),
(Command(u'דוגם שפא-עקא ןמדאשךך הןצ', ''), 'apt-get install vim'),
(Command(u'ךד -ךש', ''), 'ls -la')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert switch_lang.get_new_command(command) == new_command assert switch_lang.get_new_command(command) == new_command