Ejemplo n.º 1
0
 def _get_reference_primary_id(entref: bp.EntityReference):
     # This is a simple check to see if we should treat this as a URL
     if not entref.uid.startswith('http'):
         return None, None
     primary_ns, primary_id = parse_identifiers_url(entref.uid)
     return primary_ns, primary_id
Ejemplo n.º 2
0
def test_parse_identifiers_url():
    # Get correct namespace and ID from standard and outdated URL formats
    for ns_tuple, urls in ns_mapping.items():
        for url in urls:
            ns, db_id = parse_identifiers_url(url)
            assert (ns, db_id) == ns_tuple, (url, ns, db_id)