(self)
| 49 | self.assertEqual(input_arg.Name, 'Context') |
| 50 | |
| 51 | def test_xml_import_additional_ns(self): |
| 52 | self.srv.register_namespace('http://placeholder.toincrease.nsindex') # if not already shift the new namespaces |
| 53 | |
| 54 | # "tests/custom_nodes.xml" isn't created with namespaces in mind, provide new test file |
| 55 | self.opc.import_xml("tests/custom_nodesns.xml") # the ns=1 in to file now should be mapped to ns=2 |
| 56 | |
| 57 | ns = self.opc.get_namespace_index("http://examples.freeopcua.github.io/") |
| 58 | o = self.opc.get_objects_node() |
| 59 | |
| 60 | o2 = o.get_child(["{0:d}:MyBaseObject".format(ns)]) |
| 61 | |
| 62 | self.assertIsNotNone(o2) |
| 63 | |
| 64 | v1 = o.get_child(["{0:d}:MyBaseObject".format(ns), "{0:d}:MyVar".format(ns)]) |
| 65 | self.assertIsNotNone(v1) |
| 66 | |
| 67 | r1 = o2.get_references(refs=ua.ObjectIds.HasComponent)[0] |
| 68 | self.assertEqual(r1.NodeId.NamespaceIndex, ns) |
| 69 | |
| 70 | r3 = v1.get_references(refs=ua.ObjectIds.HasComponent)[0] |
| 71 | self.assertEqual(r3.NodeId.NamespaceIndex, ns) |
| 72 | |
| 73 | def test_xml_method(self): |
| 74 | self.opc.register_namespace("tititi") |
nothing calls this directly
no test coverage detected