def test_load_schema(yang): # Call the plugin function using the function pointer yang_model = yang.get_interface('Model') yang_module = yang.get_interface('Module') yang_node = yang.get_interface('Node') model = yang_model.alloc() print("yang_model.alloc() returned model = 0x%x" % model) status = yang_model.load_schema_ypbc(model, RwmanifestDYang.get_schema()) root = yang_model.get_root_node(model) print("yang_model.get_root_node(model) returned node = 0x%x" % root) manifest = yang_node.first_child(root) print("yang_node.first_child(root) returned node = 0x%x" % manifest) node_name = yang_node.name(manifest) print("node_name=", node_name) print("DONE") print()
def test_load_schema(yang): # Call the plugin function using the function pointer yang_model = yang.get_interface('Model') yang_module = yang.get_interface('Module') yang_node = yang.get_interface('Node') model = yang_model.alloc() print "yang_model.alloc() returned model = 0x%x" % model status = yang_model.load_schema_ypbc(model, RwmanifestDYang.get_schema()) root = yang_model.get_root_node(model) print "yang_model.get_root_node(model) returned node = 0x%x" % root manifest = yang_node.first_child(root) print "yang_node.first_child(root) returned node = 0x%x" % manifest node_name = yang_node.name(manifest) print "node_name=", node_name print "DONE" print
def test_get_schema(self): schema = RwmanifestDYang.get_schema() self.assertIsInstance(schema, gi.repository.RwYangPb.Schema)