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

Method test_method

tests/tests_common.py:554–563  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

552 self.assertEqual(idx, myid.NamespaceIndex)
553
554 def test_method(self):
555 o = self.opc.get_objects_node()
556 m = o.get_child("2:ServerMethod")
557 result = o.call_method("2:ServerMethod", 2.1)
558 self.assertEqual(result, 4.2)
559 with self.assertRaises(ua.UaStatusCodeError):
560 # FIXME: we should raise a more precise exception
561 result = o.call_method("2:ServerMethod", 2.1, 89, 9)
562 with self.assertRaises(ua.UaStatusCodeError):
563 result = o.call_method(ua.NodeId(999), 2.1) # non existing method
564
565 def test_method_array(self):
566 o = self.opc.get_objects_node()

Callers

nothing calls this directly

Calls 3

get_childMethod · 0.80
call_methodMethod · 0.80
get_objects_nodeMethod · 0.45

Tested by

no test coverage detected