2015-04-23 20:28:19 -04:00
|
|
|
from thefuck.rules.ls_lah import match, get_new_command
|
2015-08-27 16:42:09 +03:00
|
|
|
from tests.utils import Command
|
2015-04-23 20:28:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
def test_match():
|
2015-09-07 13:00:29 +03:00
|
|
|
assert match(Command(script='ls'))
|
|
|
|
assert match(Command(script='ls file.py'))
|
|
|
|
assert match(Command(script='ls /opt'))
|
|
|
|
assert not match(Command(script='ls -lah /opt'))
|
|
|
|
assert not match(Command(script='pacman -S binutils'))
|
|
|
|
assert not match(Command(script='lsof'))
|
2015-04-23 20:28:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_new_command():
|
2015-09-07 13:00:29 +03:00
|
|
|
assert get_new_command(Command(script='ls file.py')) == 'ls -lah file.py'
|
|
|
|
assert get_new_command(Command(script='ls')) == 'ls -lah'
|