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

#132 Merge pip_install_sudo rule with sudo rule

This commit is contained in:
nvbn
2015-04-29 05:01:30 +02:00
parent 4be60c78fa
commit 99d9c9aff7
4 changed files with 10 additions and 78 deletions

View File

@@ -3,12 +3,14 @@ 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)
@pytest.mark.parametrize('stderr, stdout', [
('Permission denied', ''),
('permission denied', ''),
("npm ERR! Error: EACCES, unlink", ''),
('requested operation requires superuser privilege', ''),
('', "error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/ipaddr.py'")])
def test_match(stderr, stdout):
assert match(Command(stderr=stderr, stdout=stdout), None)
def test_not_match():