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

Method test_server_method

tests/tests_server.py:140–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

138 self.assertEqual(idx, myid.NamespaceIndex)
139
140 def test_server_method(self):
141 def func(parent, variant):
142 variant.Value *= 2
143 return [variant]
144 o = self.opc.get_objects_node()
145 v = o.add_method(3, 'Method1', func, [ua.VariantType.Int64], [ua.VariantType.Int64])
146 result = o.call_method(v, ua.Variant(2.1))
147 self.assertEqual(result, 4.2)
148
149 def test_historize_variable(self):
150 o = self.opc.get_objects_node()

Callers

nothing calls this directly

Calls 3

call_methodMethod · 0.80
get_objects_nodeMethod · 0.45
add_methodMethod · 0.45

Tested by

no test coverage detected