aboutsummaryrefslogtreecommitdiff
path: root/tests/models/thl/test_soft_pair.py
diff options
context:
space:
mode:
authorMax Nanis2026-03-06 16:49:46 -0500
committerMax Nanis2026-03-06 16:49:46 -0500
commit91d040211a4ed6e4157896256a762d3854777b5e (patch)
treecd95922ea4257dc8d3f4e4cbe8534474709a20dc /tests/models/thl/test_soft_pair.py
downloadgeneralresearch-91d040211a4ed6e4157896256a762d3854777b5e.tar.gz
generalresearch-91d040211a4ed6e4157896256a762d3854777b5e.zip
Initial commitv3.3.4
Diffstat (limited to 'tests/models/thl/test_soft_pair.py')
-rw-r--r--tests/models/thl/test_soft_pair.py24
1 files changed, 24 insertions, 0 deletions
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"