@patch('pip.pep425tags.supported_tags', [
        ('pyT', 'none', 'TEST'),
        ('pyT', 'TEST', 'any'),
        ('pyT', 'none', 'any'),
    ])
    def test_link_sorting(self):
        links = [
            InstallationCandidate("simple", "2.0", Link('simple-2.0.tar.gz')),
            InstallationCandidate(
                "simple",
                "1.0",
                Link('simple-1.0-pyT-none-TEST.whl'),
            ),
            InstallationCandidate(
                "simple",
                '1.0',
                Link('simple-1.0-pyT-TEST-any.whl'),
            ),
            InstallationCandidate(
                "simple",
                '1.0',
                Link('simple-1.0-pyT-none-any.whl'),
            ),
            InstallationCandidate(
                "simple",
                '1.0',
                Link('simple-1.0.tar.gz'),
            ),
        ]

        finder = PackageFinder([], [], session=PipSession())

        results = sorted(links,
                         key=finder._candidate_sort_key, reverse=True)
        results2 = sorted(reversed(links),
                          key=finder._candidate_sort_key, reverse=True)

        assert links == results == results2, results2
The main program function.
dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py/TestWheel.test_link_sorting--crossover with--dataset/ETHPy150Open log2timeline/dfvfs/examples/recursive_hasher.py/Main