Add tests to verify --index-url behaviour
@@ -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.
