diff options
| author | Max Nanis | 2026-08-27 17:46:11 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-08-27 17:46:11 -0700 |
| commit | aeeb7fef2594ccd34fbe96a77f6c5b392299fed7 (patch) | |
| tree | de0896615df0c9747208fc26eb1ddde60f248286 /tests/models/spectrum | |
| parent | fdc170938ac4ac8fa5d9d4df1936e6dc0777f291 (diff) | |
| download | generalresearch-aeeb7fef2594ccd34fbe96a77f6c5b392299fed7.tar.gz generalresearch-aeeb7fef2594ccd34fbe96a77f6c5b392299fed7.zip | |
Ruff afternoon
Diffstat (limited to 'tests/models/spectrum')
| -rw-r--r-- | tests/models/spectrum/test_survey.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/models/spectrum/test_survey.py b/tests/models/spectrum/test_survey.py index 7ddd407..f97860f 100644 --- a/tests/models/spectrum/test_survey.py +++ b/tests/models/spectrum/test_survey.py @@ -405,3 +405,47 @@ class TestSpectrumSurvey: assert (None, {"c", "d"}) == s.determine_eligibility_soft( {"a": True, "b": True, "c": None, "d": None} ) + + +def test_spectrum_something(spectrum_api_surveys_json: list[str]): + # make sure hashes for 111111 are in db + c1 = SpectrumCondition( + question_id="1001", + value_type=ConditionValueType.LIST, + values=["a", "b", "c"], + negate=False, + logical_operator=LogicalOperator.OR, + ) + c2 = SpectrumCondition( + question_id="1001", + value_type=ConditionValueType.LIST, + values=["a"], + negate=False, + logical_operator=LogicalOperator.OR, + ) + c3 = SpectrumCondition( + question_id="1002", + value_type=ConditionValueType.RANGE, + values=["18-24", "30-32"], + negate=False, + logical_operator=LogicalOperator.OR, + ) + c4 = SpectrumCondition( + question_id="212", + value_type=ConditionValueType.LIST, + values=["23", "24"], + negate=False, + logical_operator=LogicalOperator.OR, + ) + c5 = SpectrumCondition( + question_id="1031", + value_type=ConditionValueType.LIST, + values=["113", "114", "121"], + negate=False, + logical_operator=LogicalOperator.OR, + ) + _conditions = [c1, c2, c3, c4, c5] + + survey = SpectrumSurvey.model_validate_json(spectrum_api_surveys_json[0]) + assert c1.criterion_hash in survey.qualifications + assert c3.criterion_hash in survey.qualifications |
