Use parametrized tests where it possible
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import pytest
|
||||
from thefuck.rules.sudo import match, get_new_command
|
||||
from tests.utils import Command
|
||||
|
||||
|
||||
def test_match():
|
||||
assert match(Command(stderr='Permission denied'), None)
|
||||
assert match(Command(stderr='permission denied'), None)
|
||||
assert match(Command(stderr="npm ERR! Error: EACCES, unlink"), None)
|
||||
@pytest.mark.parametrize('stderr', ['Permission denied',
|
||||
'permission denied',
|
||||
"npm ERR! Error: EACCES, unlink"])
|
||||
def test_match(stderr):
|
||||
assert match(Command(stderr=stderr), None)
|
||||
|
||||
|
||||
def test_not_match():
|
||||
assert not match(Command(), None)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user