Use parametrized tests where it possible

This commit is contained in:
nvbn
2015-04-25 02:54:39 +02:00
parent b7cb407637
commit 698451f65d
6 changed files with 85 additions and 56 deletions
+9 -3
View File
@@ -1,3 +1,4 @@
import pytest
from thefuck.rules.mkdir_p import match, get_new_command
from tests.utils import Command
@@ -6,9 +7,14 @@ def test_match():
assert match(Command('mkdir foo/bar/baz',
stderr='mkdir: foo/bar: No such file or directory'),
None)
assert not match(Command('mkdir foo/bar/baz'), None)
assert not match(Command('mkdir foo/bar/baz', stderr='foo bar baz'), None)
assert not match(Command(), None)
@pytest.mark.parametrize('command', [
Command('mkdir foo/bar/baz'),
Command('mkdir foo/bar/baz', stderr='foo bar baz'),
Command()])
def test_not_match(command):
assert not match(command, None)
def test_get_new_command():