@pytest.mark.network
def test_finder_priority_page_over_deplink():
    req = InstallRequirement.from_line('pip==1.5.6', None)
    finder = PackageFinder(
        [],
        ["https://pypi.python.org/simple"],
        process_dependency_links=True,
        session=PipSession(),
    )
    finder.add_dependency_links([
        'https://warehouse.python.org/packages/source/p/pip/pip-1.5.6.tar.gz'])
    all_versions = finder.find_all_candidates(req.name)
    # Check that the dependency_link is last
    assert all_versions[-1].location.url.startswith('https://warehouse')
    link = finder.find_requirement(req, False)
    assert link.url.startswith("https://pypi"), link
Test PackageFinder prefers page links over equivalent dependency links
dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py/test_finder_priority_page_over_deplink