MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / test_package_diff_candidates

Function test_package_diff_candidates

tests/test_package.py:118–131  ·  view source on GitHub ↗
(mock_pypi_rest_api)

Source from the content-addressed store, hash-verified

116
117@responses.activate
118def 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

Callers

nothing calls this directly

Calls 3

mock_pypi_rest_apiFunction · 0.85
from_cachedMethod · 0.80
get_diff_candidatesMethod · 0.80

Tested by

no test coverage detected