1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-21 10:08:59 +00:00
thefuck/tests/rules/test_choco_install.py
Philip Arola 05e0696ac7 Add choco_install rule
Adds a rule to append '.install' to a chocolatey install command that
failed because of a non-existent package.

TODO: add support for other suffixes (.portable), find more parameter
cases
2019-10-29 00:23:30 -07:00

13 lines
519 B
Python

import pytest
from thefuck.rules.choco_install import get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('before, after', [
('choco install logstitcher', 'choco install logstitcher.install'),
('cinst logstitcher', 'cinst logstitcher.install'),
('choco install logstitcher -y', 'choco install logstitcher.install -y'),
('cinst logstitcher -y', 'cinst logstitcher.install -y')])
def test_get_new_command(before, after):
assert (get_new_command(Command(before, '')) == after)