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

Method test_use_namespace

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

Source from the content-addressed store, hash-verified

542 self.assertEqual([1], val)
543
544 def test_use_namespace(self):
545 idx_orig = 1
546 uri = self.opc.get_namespace_array()[idx_orig]
547 idx = self.opc.get_namespace_index(uri)
548 self.assertEqual(idx_orig, idx)
549 root = self.opc.get_root_node()
550 myvar = root.add_variable(idx, 'var_in_custom_namespace', [5])
551 myid = myvar.nodeid
552 self.assertEqual(idx, myid.NamespaceIndex)
553
554 def test_method(self):
555 o = self.opc.get_objects_node()

Callers

nothing calls this directly

Calls 4

get_namespace_arrayMethod · 0.45
get_namespace_indexMethod · 0.45
get_root_nodeMethod · 0.45
add_variableMethod · 0.45

Tested by

no test coverage detected