async def test_eventgenerator_source_collision(server): objects = server.get_objects_node() o = await objects.add_object(3, 'MyObject') event = BaseEvent(sourcenode=o.nodeid) evgen = await server.get_event_generator(event, ua.ObjectIds.Server) await check_eventgenerator_base_event(evgen, server) await check_event_generator_object(evgen, o, emitting_node=asyncua.Node(server.iserver.isession, ua.ObjectIds.Server))
def test_where_clause(): cf = ua.ContentFilter() el = ua.ContentFilterElement() op = ua.SimpleAttributeOperand() op.BrowsePath.append(ua.QualifiedName("property", 2)) el.FilterOperands.append(op) for i in range(10): op = ua.LiteralOperand() op.Value = ua.Variant(i) el.FilterOperands.append(op) el.FilterOperator = ua.FilterOperator.InList cf.Elements.append(el) wce = WhereClauseEvaluator(logging.getLogger(__name__), None, cf) ev = BaseEvent() ev._freeze = False ev.property = 3 assert wce.eval(ev)
async def test_eventgenerator_BaseEvent_object(server): evgen = await server.get_event_generator(BaseEvent()) await check_eventgenerator_base_event(evgen, server) await check_eventgenerator_source_server(evgen, server)