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:
@@ -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'
|
||||
|
Reference in New Issue
Block a user