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

Method test_register_use_namespace

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

Source from the content-addressed store, hash-verified

130 self.assertEqual(idx1, idx3)
131
132 def test_register_use_namespace(self):
133 uri = 'http://my_very_custom.Namespace.com'
134 idx = self.opc.register_namespace(uri)
135 root = self.opc.get_root_node()
136 myvar = root.add_variable(idx, 'var_in_custom_namespace', [5])
137 myid = myvar.nodeid
138 self.assertEqual(idx, myid.NamespaceIndex)
139
140 def test_server_method(self):
141 def func(parent, variant):

Callers

nothing calls this directly

Calls 3

register_namespaceMethod · 0.45
get_root_nodeMethod · 0.45
add_variableMethod · 0.45

Tested by

no test coverage detected