Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If --allow-unverified is used assume it also means --allow-external #1457

Merged
merged 1 commit into from Jan 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions pip/index.py
Expand Up @@ -56,6 +56,9 @@ def __init__(self, find_links, index_urls,
normalize_name(n) for n in allow_unverified
)

# Anything that is allowed unverified is also allowed external
self.allow_external |= self.allow_unverified

# Do we allow all (safe and verifiable) externally hosted files?
self.allow_all_external = allow_all_external

Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_finder.py
Expand Up @@ -484,6 +484,22 @@ def test_finder_finds_external_links_without_hashes_scraped_all_all_insecure(dat
link = finder.find_requirement(req, False)
assert link.filename == "bar-4.0.tar.gz"


def test_finder_finds_external_links_without_hashes_scraped_insecure(data):
"""
Tests that PackageFinder finds externally scraped links without the
external flag
"""
req = InstallRequirement.from_line("bar", None)

# using a local index
finder = PackageFinder([], [data.index_url("externals")],
allow_unverified=["bar"],
)
link = finder.find_requirement(req, False)
assert link.filename == "bar-4.0.tar.gz"


class test_link_package_versions(object):

# patch this for travis which has distribute in it's base env for now
Expand Down