2015-04-20 15:49:39 +01:00
|
|
|
from thefuck.rules.python_command import match, get_new_command
|
2017-08-31 16:58:56 +01:00
|
|
|
from thefuck.types import Command
|
2015-04-20 15:49:39 +01:00
|
|
|
|
2015-04-22 22:04:22 +01:00
|
|
|
|
2015-04-20 15:49:39 +01:00
|
|
|
def test_match():
|
2017-08-31 16:58:56 +01:00
|
|
|
assert match(Command('temp.py', 'Permission denied'))
|
|
|
|
assert not match(Command('', ''))
|
2015-04-20 15:49:39 +01:00
|
|
|
|
2015-04-22 22:04:22 +01:00
|
|
|
|
2015-04-20 15:49:39 +01:00
|
|
|
def test_get_new_command():
|
2017-08-31 16:58:56 +01:00
|
|
|
assert (get_new_command(Command('./test_sudo.py', ''))
|
2016-10-06 19:51:22 +01:00
|
|
|
== 'python ./test_sudo.py')
|