mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Add tests for auto completion of short options
This commit is contained in:
parent
bca2f4ed59
commit
1b357e5810
|
@ -121,6 +121,29 @@ def test_completion_option_for_command(script):
|
|||
"autocomplete function could not complete ``--``"
|
||||
|
||||
|
||||
def test_completion_short_option(script):
|
||||
"""
|
||||
Test getting completion for short options after ``-`` (eg. pip -)
|
||||
"""
|
||||
|
||||
res, env = setup_completion(script, 'pip -', '1')
|
||||
|
||||
assert '-h' in res.stdout.split(),\
|
||||
"autocomplete function could not complete short options after ``-``"
|
||||
|
||||
|
||||
def test_completion_short_option_for_command(script):
|
||||
"""
|
||||
Test getting completion for short options after ``-`` in command
|
||||
(eg. pip search -)
|
||||
"""
|
||||
|
||||
res, env = setup_completion(script, 'pip search -', '2')
|
||||
|
||||
assert '-h' in res.stdout.split(),\
|
||||
"autocomplete function could not complete short options after ``-``"
|
||||
|
||||
|
||||
@pytest.mark.parametrize('flag', ['--bash', '--zsh', '--fish'])
|
||||
def test_completion_uses_same_executable_name(script, flag):
|
||||
expect_stderr = sys.version_info[:2] == (3, 3)
|
||||
|
|
Loading…
Reference in a new issue