Add tests to verify --index-url behaviour

This commit is contained in:
Devesh Kumar Singh 2020-04-06 17:22:57 +05:30
parent 4c70c6d350
commit ac65f136fd
1 changed files with 24 additions and 0 deletions

View File

@ -1769,6 +1769,30 @@ def test_ignore_yanked_file(script, data):
assert 'Successfully installed simple-2.0\n' in result.stdout, str(result)
def test_invalid_index_url_argument(script):
"""
Test the behaviour of an invalid --index-url argument
"""
result = script.pip('install', '--index-url', '--user',
TestPyPI.simple_url, 'simple',
expect_error=True)
assert 'WARNING: index-url --user is invalid.' in \
result.stderr, str(result)
def test_valid_index_url_argument(script):
"""
Test the behaviour of an valid --index-url argument
"""
result = script.pip('install', '--no-deps', '--index-url',
TestPyPI.simple_url, 'simple')
assert 'Successfully installed simple' in result.stdout, str(result)
def test_install_yanked_file_and_print_warning(script, data):
"""
Test install a "yanked" file and print a warning.