def test_std_address_space_references():
    aspace = AddressSpace()
    node_mgt_service = NodeManagementService(aspace)
    standard_address_space.fill_address_space(node_mgt_service)
    std_nodes = read_nodes(
        os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'schemas', 'Opc.Ua.NodeSet2.xml'))
    )
    for k in aspace.keys():
        refs = set(
            (r.ReferenceTypeId.to_string(), r.NodeId.to_string(), r.IsForward) for r in aspace[k].references
        )
        xml_refs = set(
            (r.attrib['ReferenceType'], r.text, r.attrib.get('IsForward', 'true') == 'true') for r in
                       find_elem(std_nodes[k.to_string()], 'References')
        )
        assert 0 == len(xml_refs - refs)
示例#2
0
def get_nodeid_list(aspace: AddressSpace):
    aspace_list = [a.to_string() for a in aspace.keys()]
    return aspace_list