rename to _get_index_urls_locations and fix docstring

This commit is contained in:
Xavier Fernandez 2015-03-10 23:13:06 +01:00
parent 93603ad380
commit 9d0fcf7ef5
2 changed files with 8 additions and 6 deletions

View File

@ -291,9 +291,11 @@ class PackageFinder(object):
RemovedInPip7Warning,
)
def _get_indexes_locations(self, req):
"""Returns locations found via self.index_urls
with the url_name checked on the main index
def _get_index_urls_locations(self, req):
"""Returns the locations found via self.index_urls
Checks the url_name on the main (first in the list) index and
use this url_name to produce all locations
"""
def mkurl_pypi_url(url):
@ -337,7 +339,7 @@ class PackageFinder(object):
return []
def _find_all_versions(self, req):
index_locations = self._get_indexes_locations(req)
index_locations = self._get_index_urls_locations(req)
file_locations, url_locations = self._sort_locations(index_locations)
fl_file_loc, fl_url_loc = self._sort_locations(self.find_links)
file_locations.extend(fl_file_loc)

View File

@ -715,11 +715,11 @@ class test_link_package_versions(object):
assert result == [], result
def test_get_indexes_location():
def test_get_index_urls_locations():
"""Check that the canonical name is on all indexes"""
finder = PackageFinder(
[], ['file://index1/', 'file://index2'], session=PipSession())
locations = finder._get_indexes_locations(
locations = finder._get_index_urls_locations(
InstallRequirement.from_line('Complex_Name'))
assert locations == ['file://index1/complex-name/',
'file://index2/complex-name/']