mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 04:48:57 +00:00
19 lines
679 B
Python
19 lines
679 B
Python
# -*- 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'
|