1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-19 09:08:47 +00:00
thefuck/tests/rules/test_rm_dir.py

22 lines
610 B
Python
Raw Normal View History

import pytest
from thefuck.rules.rm_dir import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command('rm foo', stderr='rm: foo: is a directory'),
Command('rm foo', stderr='rm: foo: Is a directory')])
def test_match(command):
assert match(command, None)
assert match(command, None)
@pytest.mark.parametrize('command', [
Command('rm foo'), Command('rm foo'), Command()])
def test_not_match(command):
assert not match(command, None)
def test_get_new_command():
2015-04-20 18:56:25 +02:00
assert get_new_command(Command('rm foo', '', ''), None) == 'rmdir foo'