Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions tests/test_nodenorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
import TCT

# Some example queries for these tests.
#
# NOTE: the expected `curie`/`label`/`biolink_type` values below are pinned to
# the Translator NodeNorm service, which is backed by the NCATSTranslator/Babel
# compendia. When Babel ships a new compendia release, preferred CURIEs, labels
# (including casing) and categories can shift, so these expectations may need a
# periodic refresh.
EXAMPLE_QUERIES = [
{
'query': 'MESH:D003924',
Expand All @@ -13,9 +19,9 @@
},
{
'query': 'UMLS:C0004096',
'curie': 'MONDO:0004979',
'curie': 'MONDO:0100470',
'label_with_geneprotein_conflation': 'Asthma',
'label': 'asthma',
'label': 'Asthma',
'biolink_type': 'biolink:Disease',
'drug_chemical_conflate': True,
'conflate': True,
Expand All @@ -31,10 +37,10 @@
},
{
'query': 'DRUGBANK:DB00083',
'curie': 'UMLS:C0006050',
'curie': 'DRUGBANK:DB00083',
'label_with_geneprotein_conflation': 'Botulinum toxin type A',
'label': 'Dysport',
'biolink_type': 'biolink:Protein',
'label': 'Botulinum toxin type A',
'biolink_type': 'biolink:ChemicalEntity',
'drug_chemical_conflate': True,
'conflate': True,
},
Expand Down Expand Up @@ -76,12 +82,15 @@
def test_nodenorm_status():
"""
Test that NodeNorm can return status information.

Note: unlike NameRes, the NodeNorm ``/status`` endpoint does not report a
``babel_version`` (that compendia metadata lives on the NameRes status), so
we only assert the fields NodeNorm actually exposes: ``status`` and the
underlying database counts.
"""
status = TCT.node_normalizer.status()

assert status['status'] == 'running'
assert status['babel_version'] != ''
assert status['babel_version_url'] != ''
assert status['databases']['eq_id_to_id_db']['count'] > 650_000_000


Expand Down
Loading