From f372f3d56cecb3b00ccee6f3b74935aece4ba013 Mon Sep 17 00:00:00 2001 From: Stef Pletinck Date: Sat, 7 Oct 2017 13:59:32 +0200 Subject: [PATCH] Added test --- tests/rules/test_git_remote_delete.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/rules/test_git_remote_delete.py diff --git a/tests/rules/test_git_remote_delete.py b/tests/rules/test_git_remote_delete.py new file mode 100644 index 0000000..660f0c8 --- /dev/null +++ b/tests/rules/test_git_remote_delete.py @@ -0,0 +1,21 @@ +import pytest +from thefuck.rules.git_remote_delete import get_new_command, match +from thefuck.types import Command + + +def test_match(): + assert match(Command('git remote delete foo', '')) + + +@pytest.mark.parametrize('command', [ + Command('git remote remove foo', ''), + Command('git remote add foo', ''), + Command('git commit', '') +]) +def test_not_match(command): + assert not match(command) + + +def test_get_new_command(): + new_command = get_new_command(Command('git remote delete foo', '')) + assert new_command == 'git remote remove foo'