Add some assertions to BestCandidateResult.__init__().

This commit is contained in:
Chris Jerdonek 2019-07-19 22:45:54 -04:00
parent a644fb074f
commit 3eb803aa26
1 changed files with 7 additions and 0 deletions

View File

@ -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