1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-19 03:32:31 +01:00

#68 Add rule for switching layout

This commit is contained in:
nvbn
2015-04-21 06:26:15 +02:00
parent 5ccf163594
commit e7d5d93056
4 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
# -*- encoding: utf-8 -*-
from mock import Mock
from thefuck.rules import switch_lang
def test_match():
assert switch_lang.match(Mock(stderr='command not found: фзе-пуе',
script=u'фзе-пуе'), None)
assert not switch_lang.match(Mock(stderr='command not found: pat-get',
script=u'pat-get'), None)
assert not switch_lang.match(Mock(stderr='some info',
script=u'фзе-пуе'), None)
def test_get_new_command():
assert switch_lang.get_new_command(
Mock(script=u'фзе-пуе штыефдд мшь'), None) == 'apt-get install vim'