mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
Update tests
This commit is contained in:
parent
7318227825
commit
9d49d3957b
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
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
|
from thefuck.types import Command
|
||||||
|
|
||||||
|
|
||||||
@ -25,3 +25,13 @@ def test_match(script, goenv_cmd, output):
|
|||||||
])
|
])
|
||||||
def test_not_match(script, output):
|
def test_not_match(script, output):
|
||||||
assert not match(Command(script, output=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))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
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
|
from thefuck.types import Command
|
||||||
|
|
||||||
|
|
||||||
@ -25,3 +25,13 @@ def test_match(script, nodenv_cmd, output):
|
|||||||
])
|
])
|
||||||
def test_not_match(script, output):
|
def test_not_match(script, output):
|
||||||
assert not match(Command(script, output=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))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
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
|
from thefuck.types import Command
|
||||||
|
|
||||||
|
|
||||||
@ -25,3 +25,13 @@ def test_match(script, pyenv_cmd, output):
|
|||||||
])
|
])
|
||||||
def test_not_match(script, output):
|
def test_not_match(script, output):
|
||||||
assert not match(Command(script, output=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))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
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
|
from thefuck.types import Command
|
||||||
|
|
||||||
|
|
||||||
@ -25,3 +25,13 @@ def test_match(script, rbenv_cmd, output):
|
|||||||
])
|
])
|
||||||
def test_not_match(script, output):
|
def test_not_match(script, output):
|
||||||
assert not match(Command(script, output=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))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user