1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 10:51:11 +01:00
thefuck/tests/rules/test_sudo.py
Trace d3295e6a4e Hoping this fixes the issue of it not working.
Still new to this project. My problem of it not working (I admit to being at fault) was that I had not added the same rule to the test case.
2015-04-28 11:59:15 -05:00

20 lines
599 B
Python

import pytest
from thefuck.rules.sudo import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('stderr', ['Permission denied',
'permission denied',
"npm ERR! Error: EACCES, unlink",
'requested operation requires superuser privilege'])
def test_match(stderr):
assert match(Command(stderr=stderr), None)
def test_not_match():
assert not match(Command(), None)
def test_get_new_command():
assert get_new_command(Command('ls'), None) == 'sudo ls'