1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

working on adding tests. It looks like the case of multiple extras not exisiting isn't handled

This commit is contained in:
derwolfe 2014-12-30 19:41:11 -06:00
parent 91f80102dd
commit fec9f4fde9
2 changed files with 69 additions and 48 deletions

View file

@ -443,7 +443,9 @@ class RequirementSet(object):
# req_to_install.extras are the extras
# the user *would like* to install.
# how to get the available options
print req_to_install.extras
# _dep_map has both extras and something else
# but it is: [Requirement.parse('simple==1.0')]
print dist._dep_map # maybe?
for subreq in dist.requires(
req_to_install.extras):
if self.has_requirement(

View file

@ -2,57 +2,76 @@
temporarily locate test here to make it fail faster
"""
# def test_non_existant_extra_warns_user_with_wheel(script, data):
# """
# A warning is logged telling the user that the extra option they requested
# does not exist in the project they are wishing to install
# """
# result = script.pip(
# 'install', '--use-wheel', '--no-index',
# '--find-links=' + data.find_links,
# 'simplewheel[nonexistant]', expect_stderr=True,
# )
# assert (
# "simplewheel 2.0 has no such extra feature 'nonexistant'"
# in result.stdout
# )
def test_non_existant_extra_warns_user_with_wheel(script, data):
"""
A warning is logged telling the user that the extra option they requested
does not exist in the project they are wishing to install
"""
result = script.pip(
'install', '--use-wheel', '--no-index',
'--find-links=' + data.find_links,
'simplewheel[nonexistant]', expect_stderr=True,
)
assert (
"simplewheel 2.0 has no such extra feature 'nonexistant'"
in result.stdout
)
# def test_non_existant_extra_warns_user_no_wheel(script, data):
# """
# A warning is logged telling the user that the extra option they requested
# does not exist in the project they are wishing to install.
def test_non_existant_extra_warns_user_no_wheel(script, data):
"""
A warning is logged telling the user that the extra option they requested
does not exist in the project they are wishing to install.
# This is meant to exercise the code that is meant for non-wheel installs.
# """
# result = script.pip(
# 'install', '--no-use-wheel', '--no-index',
# '--find-links=' + data.find_links,
# 'simple[nonexistant]', expect_stderr=True,
# )
# assert (
# "simple 3.0 has no such extra feature 'nonexistant'"
# in result.stdout
# )
This is meant to exercise the code that is meant for non-wheel installs.
"""
result = script.pip(
'install', '--no-use-wheel', '--no-index',
'--find-links=' + data.find_links,
'simple[nonexistant]', expect_stderr=True,
)
assert (
"simple 3.0 has no such extra feature 'nonexistant'"
in result.stdout
)
# def test_non_existant_extras_warn_user_no_wheel(script, data):
# """
# Warn the user for each extra that doesn't exist.
# """
# result = script.pip(
# 'install', '--use-wheel', '--no-index',
# '--find-links=' + data.find_links,
# 'simplewheel[nonexistant]', expect_stderr=True,
# )
# assert (
# "simple 3.0 has no such extra feature 'nonexistant'"
# in result.stdout
# )
# assert (
# "simple 3.0 has no such extra feature 'nope'"
# in result.stdout
# )
def test_non_existant_extras_warn_user_with_wheel(script, data):
"""
Warn the user for each extra that doesn't exist.
"""
result = script.pip(
'install', '--use-wheel', '--no-index',
'--find-links=' + data.find_links,
'simplewheel[nonexistant]', expect_stderr=True,
)
assert (
"simplewheel 2.0 has no such extra feature 'nonexistant'"
in result.stdout
)
assert (
"simplewheel 2.0 has no such extra feature 'nope'"
in result.stdout
)
def test_shows_existing_extrasl(script, data):
def test_non_existant_extras_warn_user_with_wheel(script, data):
"""
Warn the user for each extra that doesn't exist.
"""
result = script.pip(
'install', '--no-use-wheel', '--no-index',
'--find-links=' + data.find_links,
'simple[nonexistant, nope]', expect_stderr=True,
)
assert (
"simple 3.0 has no such extra feature 'nonexistant'"
in result.stdout
)
assert (
"simple 3.0 has no such extra feature 'nope'"
in result.stdout
)
# this is just meant to be used for development
def test_shows_existing_available_extras(script, data):
"""
Warn the user for each extra that doesn't exist.
"""