xonsh/tests/completers/test_pip_completer.py
Gil Forsyth 839e0ad1a6
Fix pip completer misfires on bagpipes and similar
Requires a word-ending before `pip`, also adding in support for `xpip`
2019-05-30 15:25:16 -04:00

39 lines
800 B
Python

import pytest
from xonsh.completers.pip import PIP_RE, PIP_LIST_RE
@pytest.mark.parametrize(
"line", ["pip", "xpip search", "$(pip", "![pip", "$[pip", "!(xpip"]
)
def test_pip_re(line):
assert PIP_RE.search(line)
@pytest.mark.parametrize(
"line",
[
"pip show",
"xpip uninstall",
"$(pip show",
"![pip uninstall",
"$[pip show",
"!(xpip uninstall",
],
)
def test_pip_list_re(line):
assert PIP_LIST_RE.search(line)
@pytest.mark.parametrize(
"line",
[
"bagpipes show",
"toxbagpip uninstall",
"$(tompippery show",
"![thewholepipandpaboodle uninstall",
"$[littlebopip show",
"!(boxpip uninstall",
],
)
def test_pip_list_re(line):
assert PIP_RE.search(line) is None