mirror of https://github.com/pypa/pip
Add some assertions to BestCandidateResult.__init__().
This commit is contained in:
parent
a644fb074f
commit
3eb803aa26
|
@ -565,6 +565,13 @@ class BestCandidateResult(object):
|
|||
:param best_candidate: The most preferred candidate found, or None
|
||||
if no applicable candidates were found.
|
||||
"""
|
||||
assert set(applicable_candidates) <= set(candidates)
|
||||
|
||||
if best_candidate is None:
|
||||
assert not applicable_candidates
|
||||
else:
|
||||
assert best_candidate in applicable_candidates
|
||||
|
||||
self._applicable_candidates = applicable_candidates
|
||||
self._candidates = candidates
|
||||
|
||||
|
|
Loading…
Reference in New Issue