mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Address review comments
This commit is contained in:
parent
ac65f136fd
commit
efd6dd28d0
2 changed files with 13 additions and 11 deletions
|
@ -86,14 +86,15 @@ class SearchScope(object):
|
|||
# Parse the URL
|
||||
purl = urllib_parse.urlsplit(redacted_index_url)
|
||||
|
||||
# URL is generally invalid if scheme and netlock is missing
|
||||
# URL is generally invalid if scheme and netloc is missing
|
||||
# there are issues with Python and URL parsing, so this test
|
||||
# is a bit crude. See bpo-20271, bpo-23505. Python doesn't
|
||||
# always parse invalid URLs correctly - it should raise
|
||||
# exceptions for malformed URLs
|
||||
if not purl.scheme and not purl.netloc:
|
||||
logger.warning('index-url {} is invalid.'.format(
|
||||
redacted_index_url))
|
||||
logger.warning(
|
||||
'The index url "{}" seems invalid, '
|
||||
'please provide a scheme.'.format(redacted_index_url))
|
||||
|
||||
redacted_index_urls.append(redacted_index_url)
|
||||
|
||||
|
|
|
@ -1769,28 +1769,29 @@ 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):
|
||||
def test_invalid_index_url_argument(script, shared_data):
|
||||
"""
|
||||
Test the behaviour of an invalid --index-url argument
|
||||
"""
|
||||
|
||||
result = script.pip('install', '--index-url', '--user',
|
||||
TestPyPI.simple_url, 'simple',
|
||||
shared_data.find_links3, "Dinner",
|
||||
expect_error=True)
|
||||
|
||||
assert 'WARNING: index-url --user is invalid.' in \
|
||||
result.stderr, str(result)
|
||||
assert 'WARNING: The index url "--user" seems invalid, ' \
|
||||
'please provide a scheme.' in result.stderr, str(result)
|
||||
|
||||
|
||||
def test_valid_index_url_argument(script):
|
||||
def test_valid_index_url_argument(script, shared_data):
|
||||
"""
|
||||
Test the behaviour of an valid --index-url argument
|
||||
"""
|
||||
|
||||
result = script.pip('install', '--no-deps', '--index-url',
|
||||
TestPyPI.simple_url, 'simple')
|
||||
result = script.pip('install', '--index-url',
|
||||
shared_data.find_links3,
|
||||
"Dinner")
|
||||
|
||||
assert 'Successfully installed simple' in result.stdout, str(result)
|
||||
assert 'Successfully installed Dinner' in result.stdout, str(result)
|
||||
|
||||
|
||||
def test_install_yanked_file_and_print_warning(script, data):
|
||||
|
|
Loading…
Reference in a new issue