From 91d040211a4ed6e4157896256a762d3854777b5e Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Fri, 6 Mar 2026 16:49:46 -0500 Subject: Initial commit --- tests/models/thl/test_soft_pair.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/models/thl/test_soft_pair.py (limited to 'tests/models/thl/test_soft_pair.py') diff --git a/tests/models/thl/test_soft_pair.py b/tests/models/thl/test_soft_pair.py new file mode 100644 index 0000000..bac0e8d --- /dev/null +++ b/tests/models/thl/test_soft_pair.py @@ -0,0 +1,24 @@ +from generalresearch.models import Source +from generalresearch.models.thl.soft_pair import SoftPairResult, SoftPairResultType + + +def test_model(): + from generalresearch.models.dynata.survey import ( + DynataCondition, + ConditionValueType, + ) + + c1 = DynataCondition( + question_id="1", value_type=ConditionValueType.LIST, values=["a", "b"] + ) + c2 = DynataCondition( + question_id="2", value_type=ConditionValueType.LIST, values=["c", "d"] + ) + sr = SoftPairResult( + pair_type=SoftPairResultType.CONDITIONAL, + source=Source.DYNATA, + survey_id="xxx", + conditions={c1, c2}, + ) + assert sr.grpc_string == "xxx:1;2" + assert sr.survey_sid == "d:xxx" -- cgit v1.2.3