Skip to content

Commit

Permalink
Improved output.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Nov 6, 2023
1 parent d005754 commit 663081b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_curies.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# Identifiers to check for.
CURIES_TO_TEST = [
# Identifiers from https://github.com/ExposuresProvider/cam-pipeline/issues/101
'PUBCHEM.COMPOUND:5865', # Prednisone |
'PUBCHEM.COMPOUND:5462351', # Dextromethorphan hydrobromide (CHEMBL.COMPOUND:CHEMBL1256818) |
'PUBCHEM.COMPOUND:165363555', # Trifacta |
Expand Down Expand Up @@ -97,13 +98,14 @@ def test_identifier(curie):
'xref_list': edge['xref'],
'primary_knowledge_source': edge['biolink:primary_knowledge_source'],
'id': obj['id'],
'label': obj.get('label', ''),
'label': obj.get('name', ''),
}

linked_nodes.append(linked_node)

assert len(linked_nodes) > 0, f"No linked nodes found for CURIE {curie} in {CAM_KP_API_ENDPOINT}"

print(f"Found linked nodes for CURIE {curie}:")
linked_curies = set([n['id'] for n in linked_nodes])
print(f"Found {len(linked_nodes)} linked nodes (with {len(linked_curies)} unique CURIEs) for CURIE {curie}:")
for linked_node in linked_nodes:
print(f" - {linked_node['id']} ({linked_node['label']}): {linked_node['primary_knowledge_source']} at {linked_node['xref_list']}")
print(f" - {linked_node['id']} ({linked_node['label']}): {linked_node['primary_knowledge_source']} at {linked_node['xref_list']}")

0 comments on commit 663081b

Please sign in to comment.