Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/test_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,17 @@ def test_all_required_keys_present(self):
def test_returns_dict(self):
cert = build_certificate(_make_scored(), {}, [])
assert isinstance(cert, dict)

def test_empty_selection_reason_passthrough(self):
# The _make_scored() helper uses `or` so it cannot test selection_reason=[].
# This test bypasses the helper to verify the production code handles an empty list.
# The JSON schema allows an empty array (no minItems constraint).
scored = ScoredCandidate(
candidate=_CANDIDATE,
features=_FEATURES,
scores=_SCORES,
selection_reason=[],
known_failure_modes=["No wet-lab assay has been run."],
)
cert = build_certificate(scored, {}, [])
assert cert["selection_reason"] == []
Loading