1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +00:00

Update tests

This commit is contained in:
gkodosis 2020-07-06 14:33:32 +03:00
parent 7318227825
commit 9d49d3957b
4 changed files with 44 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import pytest
from thefuck.rules.goenv_no_such_command import match
from thefuck.rules.goenv_no_such_command import get_new_command, match
from thefuck.types import Command
@ -25,3 +25,13 @@ def test_match(script, goenv_cmd, output):
])
def test_not_match(script, output):
assert not match(Command(script, output=output))
@pytest.mark.parametrize('script, goenv_cmd, result', [
('goenv globe', 'globe', 'goenv global'),
('goenv intall 3.8.0', 'intall', 'goenv install 3.8.0'),
('goenv list', 'list', 'goenv install --list'),
('goenv remove 3.8.0', 'remove', 'goenv uninstall 3.8.0'),
])
def test_get_new_command(script, goenv_cmd, output, result):
assert result in get_new_command(Command(script, output))

View File

@ -1,6 +1,6 @@
import pytest
from thefuck.rules.nodenv_no_such_command import match
from thefuck.rules.nodenv_no_such_command import get_new_command, match
from thefuck.types import Command
@ -25,3 +25,13 @@ def test_match(script, nodenv_cmd, output):
])
def test_not_match(script, output):
assert not match(Command(script, output=output))
@pytest.mark.parametrize('script, nodenv_cmd, result', [
('nodenv globe', 'globe', 'nodenv global'),
('nodenv intall 3.8.0', 'intall', 'nodenv install 3.8.0'),
('nodenv list', 'list', 'nodenv install --list'),
('nodenv remove 3.8.0', 'remove', 'nodenv uninstall 3.8.0'),
])
def test_get_new_command(script, nodenv_cmd, output, result):
assert result in get_new_command(Command(script, output))

View File

@ -1,6 +1,6 @@
import pytest
from thefuck.rules.pyenv_no_such_command import match
from thefuck.rules.pyenv_no_such_command import get_new_command, match
from thefuck.types import Command
@ -25,3 +25,13 @@ def test_match(script, pyenv_cmd, output):
])
def test_not_match(script, output):
assert not match(Command(script, output=output))
@pytest.mark.parametrize('script, pyenv_cmd, result', [
('pyenv globe', 'globe', 'pyenv global'),
('pyenv intall 3.8.0', 'intall', 'pyenv install 3.8.0'),
('pyenv list', 'list', 'pyenv install --list'),
('pyenv remove 3.8.0', 'remove', 'pyenv uninstall 3.8.0'),
])
def test_get_new_command(script, pyenv_cmd, output, result):
assert result in get_new_command(Command(script, output))

View File

@ -1,6 +1,6 @@
import pytest
from thefuck.rules.rbenv_no_such_command import match
from thefuck.rules.rbenv_no_such_command import get_new_command, match
from thefuck.types import Command
@ -25,3 +25,13 @@ def test_match(script, rbenv_cmd, output):
])
def test_not_match(script, output):
assert not match(Command(script, output=output))
@pytest.mark.parametrize('script, rbenv_cmd, result', [
('rbenv globe', 'globe', 'rbenv global'),
('rbenv intall 3.8.0', 'intall', 'rbenv install 3.8.0'),
('rbenv list', 'list', 'rbenv install --list'),
('rbenv remove 3.8.0', 'remove', 'rbenv uninstall 3.8.0'),
])
def test_get_new_command(script, rbenv_cmd, output, result):
assert result in get_new_command(Command(script, output))