2015-04-20 10:49:39 -04:00
|
|
|
from thefuck.rules.python_command import match, get_new_command
|
2017-08-31 17:58:56 +02:00
|
|
|
from thefuck.types import 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():
|
2017-08-31 17:58:56 +02:00
|
|
|
assert match(Command('temp.py', 'Permission denied'))
|
|
|
|
assert not match(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_get_new_command():
|
2017-08-31 17:58:56 +02:00
|
|
|
assert (get_new_command(Command('./test_sudo.py', ''))
|
2016-10-06 14:51:22 -04:00
|
|
|
== 'python ./test_sudo.py')
|