'Download links from the pypi simple index should be used before
external download links.
https://bitbucket.org/tarek/distribute/issue/163
Usecase :
- someone uploads a package on pypi, a md5 is generated
- someone manually copies this link (with the md5 in the url) onto an
external page accessible from the package page.
- someone reuploads the package (with a different md5)
- while easy_installing, an MD5 error occurs because the external link
is used
-> Setuptools should use the link from pypi, not the external one.'

def test_links_priority(self):

    if sys.platform.startswith('java'):
        return
    server = IndexServer()
    server.start()
    index_url = (server.base_url() + 'test_links_priority/simple/')
    pi = setuptools.package_index.PackageIndex(index_url)
    requirement = pkg_resources.Requirement.parse('foobar')
    pi.find_packages(requirement)
    server.stop()
    self.assertTrue(('foobar' in pi))
    self.assertTrue((len(pi['foobar']) == 1))
    self.assertTrue(('correct_md5' in pi['foobar'][0].location))
