mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-20 12:12:38 +01:00
Use parametrized tests where it possible
This commit is contained in:
@@ -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():
|
||||
|
Reference in New Issue
Block a user