@pytest.mark.network
def test_finder_detects_latest_already_satisfied_find_links(data):
    req = InstallRequirement.from_line('simple', None)
    # the latest simple in local pkgs is 3.0
    latest_version = "3.0"
    satisfied_by = Mock(
        location="/path",
        parsed_version=parse_version(latest_version),
        version=latest_version
    )
    req.satisfied_by = satisfied_by
    finder = PackageFinder([data.find_links], [], session=PipSession())

    with pytest.raises(BestVersionAlreadyInstalled):
        finder.find_requirement(req, True)
Test PackageFinder detects latest already satisfied using find-links
dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py/test_finder_detects_latest_already_satisfied_find_links