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

Method test_method_array

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

Source from the content-addressed store, hash-verified

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()
567 m = o.get_child("2:ServerMethodArray")
568 result = o.call_method(m, "sin", ua.Variant(math.pi))
569 self.assertTrue(result < 0.01)
570 with self.assertRaises(ua.UaStatusCodeError) as cm:
571 result = o.call_method(m, "cos", ua.Variant(math.pi))
572 self.assertEqual(cm.exception.code, ua.StatusCodes.BadInvalidArgument)
573 with self.assertRaises(ua.UaStatusCodeError) as cm:
574 result = o.call_method(m, "panic", ua.Variant(math.pi))
575 self.assertEqual(cm.exception.code, ua.StatusCodes.BadOutOfMemory)
576
577 def test_method_array2(self):
578 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