def test_evaluate_link( self, py_version_info, ignore_requires_python, expected, ): link = Link( 'https://example.com/#egg=twine-1.12', requires_python='== 3.6.5', ) search = Search( supplied='twine', canonical='twine', formats=['source'], ) evaluator = CandidateEvaluator( [], py_version_info=py_version_info, ignore_requires_python=ignore_requires_python, ) actual = evaluator.evaluate_link(link, search=search) assert actual == expected
def test_evaluate_link__incompatible_wheel(self): """ Test an incompatible wheel. """ target_python = TargetPython(py_version_info=(3, 6, 4)) # Set the valid tags to an empty list to make sure nothing matches. target_python._valid_tags = [] evaluator = CandidateEvaluator( allow_yanked=True, target_python=target_python, ) link = Link('https://example.com/sample-1.0-py2.py3-none-any.whl') search = Search( supplied='sample', canonical='sample', formats=['binary'], ) actual = evaluator.evaluate_link(link, search=search) expected = ( False, "none of the wheel's tags match: py2-none-any, py3-none-any") assert actual == expected