2015-04-22 23:04:22 +02:00
|
|
|
from thefuck.types import Command
|
2015-04-20 10:49:39 -04:00
|
|
|
from thefuck.rules.python_command import match, get_new_command
|
2015-04-20 10:49:39 -04:00
|
|
|
|
2015-04-22 23:04:22 +02:00
|
|
|
|
2015-04-20 10:49:39 -04:00
|
|
|
def test_match():
|
2015-04-20 10:49:39 -04:00
|
|
|
assert match(Command('temp.py', '', 'Permission denied'), None)
|
2015-04-20 10:49:39 -04:00
|
|
|
assert not match(Command('', '', ''), None)
|
|
|
|
|
2015-04-22 23:04:22 +02:00
|
|
|
|
2015-04-20 10:49:39 -04:00
|
|
|
def test_get_new_command():
|
|
|
|
assert get_new_command(Command('./test_sudo.py', '', ''), None) == 'python ./test_sudo.py'
|