Skip to content

Commit

Permalink
Belatedly moved a unit test for ontology from graph-validation-test-r…
Browse files Browse the repository at this point in the history
…unners to reasoner-validator
  • Loading branch information
RichardBruskiewich committed May 18, 2024
1 parent 7e31fe4 commit 09c334f
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/test_ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from reasoner_validator.utils.http import post_query
from reasoner_validator.biolink.ontology import (
ONTOLOGY_KP_TRAPI_SERVER,
NODE_NORMALIZER_SERVER
NODE_NORMALIZER_SERVER,
get_parent_concept
)

pytest_plugins = ('pytest_asyncio',)
Expand Down Expand Up @@ -77,3 +78,28 @@ async def test_post_query_to_node_normalization(curie: str, category: str):
assert "equivalent_identifiers" in result[curie]
assert len(result[curie]["equivalent_identifiers"])
assert category in result[curie]["type"]


@pytest.mark.parametrize(
"curie,category,result",
[
( # Query 0 - chemical compounds are NOT in an ontology hierarchy
"CHEMBL.COMPOUND:CHEMBL2333026",
"biolink:SmallMolecule",
None
),
( # Query 1 - MONDO disease terms are in an ontology term hierarchy
"MONDO:0011027",
"biolink:Disease",
"MONDO:0015967"
),
( # Query 2 - HP phenotype terms are in an ontology term hierarchy
"HP:0040068", # "Abnormality of limb bone"
"biolink:PhenotypicFeature",
"HP:0000924" # Abnormality of the skeletal system
)
]
)
def test_get_parent_concept(curie: str, category: str, result: Optional[str]):
# Just use default Biolink Model release for this test
assert get_parent_concept(curie=curie, category=category, biolink_version=None) == result

0 comments on commit 09c334f

Please sign in to comment.