(mock_pypi_rest_api)
| 116 | |
| 117 | @responses.activate |
| 118 | def test_package_diff_candidates(mock_pypi_rest_api): |
| 119 | mock_pypi_rest_api(responses) |
| 120 | convert = lambda x: (x[0]["filename"], x[1]["filename"]) |
| 121 | requests = package.PypiPackage.from_cached("requests") |
| 122 | requests2 = package.PypiPackage.from_cached("requests2") |
| 123 | |
| 124 | candidates = tuple(map(convert, requests.get_diff_candidates(requests2))) |
| 125 | assert ('requests-2.16.0.tar.gz', 'requests2-2.16.0.tar.gz') in candidates |
| 126 | assert ('requests-2.24.0.tar.gz', 'requests2-2.16.0.tar.gz') not in candidates |
| 127 | |
| 128 | requests.opts["diff_include_latest"] = True |
| 129 | candidates = tuple(map(convert, requests.get_diff_candidates(requests2))) |
| 130 | assert ('requests-2.16.0.tar.gz', 'requests2-2.16.0.tar.gz') in candidates |
| 131 | assert ('requests-2.24.0.tar.gz', 'requests2-2.16.0.tar.gz') in candidates |
nothing calls this directly
no test coverage detected