summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorc22 <c22@users.noreply.github.com>2016-07-21 09:57:20 +1000
committerc22 <c22@users.noreply.github.com>2016-09-23 09:19:47 +1000
commitaef0254953ec2c0027a3a9d14b3b3d6445aff23e (patch)
treec261bf3d31b771ff497ac8ac638c569a64a1bd49 /tests
parent7954523ce3174ee1677f1fdc6bcca8efb2b5e95a (diff)
downloadpip-aef0254953ec2c0027a3a9d14b3b3d6445aff23e.tar.gz
Added pip completion support for fish shell.
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/test_completion.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/functional/test_completion.py b/tests/functional/test_completion.py
index 5680f9f02..6d9cf01ee 100644
--- a/tests/functional/test_completion.py
+++ b/tests/functional/test_completion.py
@@ -37,6 +37,23 @@ compctl -K _pip_completion pip"""
assert zsh_completion in result.stdout, 'zsh completion is wrong'
+def test_completion_for_fish(script):
+ """
+ Test getting completion for fish shell
+ """
+ fish_completion = """\
+ function __fish_complete_pip
+ set -lx COMP_WORDS (commandline -o) ""
+ set -lx COMP_CWORD (math (contains -i -- (commandline -t) $COMP_WORDS)-1)
+ set -lx PIP_AUTO_COMPLETE 1
+ string split \ -- (eval $COMP_WORDS[1])
+ end
+ complete -fa "(__fish_complete_pip)" -c pip"""
+
+ result = script.pip('completion', '--fish')
+ assert fish_completion in result.stdout, 'fish completion is wrong'
+
+
def test_completion_for_unknown_shell(script):
"""
Test getting completion for an unknown shell