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

Method test_custom_enum_struct

tests/tests_client.py:153–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

151 self.assertFalse(uaclt._thread.is_alive())
152
153 def test_custom_enum_struct(self):
154 self.ro_clt.load_type_definitions()
155 ns = self.ro_clt.get_namespace_index('http://yourorganisation.org/struct_enum_example/')
156 myvar = self.ro_clt.get_node(ua.NodeId(6009, ns))
157 val = myvar.get_value()
158 self.assertEqual(val.IntVal1, 242)
159 self.assertEqual(val.EnumVal, ua.ExampleEnum.EnumVal2)
160
161 @mock.patch("opcua.common.subscription.Subscription.reconciliate")
162 @mock.patch("opcua.common.node.Node.call_method")

Callers

nothing calls this directly

Calls 4

get_valueMethod · 0.80
load_type_definitionsMethod · 0.45
get_namespace_indexMethod · 0.45
get_nodeMethod · 0.45

Tested by

no test coverage detected