1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-29 16:42:30 +01:00

Pass settings to the rules

This commit is contained in:
nvbn
2015-04-08 21:08:35 +02:00
parent 173a4300b4
commit 9ed022d67f
8 changed files with 50 additions and 47 deletions

View File

@@ -3,11 +3,11 @@ from thefuck.rules.sudo import match, get_new_command
def test_match():
assert match(Command('', '', 'Permission denied'))
assert match(Command('', '', 'permission denied'))
assert match(Command('', '', "npm ERR! Error: EACCES, unlink"))
assert not match(Command('', '', ''))
assert match(Command('', '', 'Permission denied'), None)
assert match(Command('', '', 'permission denied'), None)
assert match(Command('', '', "npm ERR! Error: EACCES, unlink"), None)
assert not match(Command('', '', ''), None)
def test_get_new_command():
assert get_new_command(Command('ls', '', '')) == 'sudo ls'
assert get_new_command(Command('ls', '', ''), None) == 'sudo ls'