-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make uri_to_curie slightly more robust
- Loading branch information
1 parent
1047f3d
commit 9b4137b
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
eva_cttv_pipeline/clinvar_xml_io/tests/test_ontology_uri.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from eva_cttv_pipeline.clinvar_xml_io.clinvar_xml_io.ontology_uri import OntologyUri | ||
|
||
|
||
def test_uri_to_curie(): | ||
assert OntologyUri.uri_to_curie('http://www.orpha.net/ORDO/Orphanet_713') == 'Orphanet:713' | ||
assert OntologyUri.uri_to_curie('http://purl.obolibrary.org/obo/HP_0002930') == 'HP:0002930' | ||
assert OntologyUri.uri_to_curie('https://omim.org/entry/300377') == 'OMIM:300377' | ||
# If for some reason we're already passed a CURIE (probably a mistake in OLS response), return it as-is | ||
assert OntologyUri.uri_to_curie('HP:0002505') == 'HP:0002505' | ||
# Not a supported db | ||
assert OntologyUri.uri_to_curie('http://purl.obolibrary.org/obo/DOID_10652') == None |