MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / test_where_clause

Method test_where_clause

tests/tests_unit.py:621–644  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

619 self.assertTrue(n.has_null_identifier())
620
621 def test_where_clause(self):
622 cf = ua.ContentFilter()
623
624 el = ua.ContentFilterElement()
625
626 op = ua.SimpleAttributeOperand()
627 op.BrowsePath.append(ua.QualifiedName("property", 2))
628 el.FilterOperands.append(op)
629
630 for i in range(10):
631 op = ua.LiteralOperand()
632 op.Value = ua.Variant(i)
633 el.FilterOperands.append(op)
634
635 el.FilterOperator = ua.FilterOperator.InList
636 cf.Elements.append(el)
637
638 wce = WhereClauseEvaluator(logging.getLogger(__name__), None, cf)
639
640 ev = BaseEvent()
641 ev._freeze = False
642 ev.property = 3
643
644 self.assertTrue(wce.eval(ev))
645
646
647class TestMaskEnum(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

evalMethod · 0.95
BaseEventClass · 0.90

Tested by

no test coverage detected