Skip to content

Commit 3b5c0ce

Browse files
committed
fix(spp_cel_domain): strengthen relational predicate test assertion
Replace weak operator-only check with an exact tuple match to prevent false positives from incorrect values (e.g. True instead of False).
1 parent 6500a3e commit 3b5c0ce

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

spp_cel_domain/tests/test_cel_relational_predicate.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ def test_one2many_predicate_produces_correct_domain(self):
7373
self.assertTrue(result["valid"], f"Error: {result.get('error')}")
7474
# The domain should contain a check for "has records"
7575
domain = result["domain"]
76-
# Look for the field check in the domain
77-
found = False
78-
for leaf in domain:
79-
if isinstance(leaf, tuple) and leaf[0] == "program_membership_ids" and leaf[1] == "!=":
80-
found = True
81-
break
82-
self.assertTrue(found, f"Expected '!= False' domain for one2many, got: {domain}")
76+
# Look for the exact expected leaf in the domain
77+
expected_leaf = ("program_membership_ids", "!=", False)
78+
found = any(leaf == expected_leaf for leaf in domain if isinstance(leaf, tuple))
79+
self.assertTrue(found, f"Expected '{expected_leaf}' to be in domain, but got: {domain}")

0 commit comments

Comments
 (0)