Skip to content

Commit

Permalink
Update test_reader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 24, 2024
1 parent 04b1f8e commit 8bb0370
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,3 +727,27 @@ def test_synonym_url(self) -> None:
],
synonym.provenance,
)

def test_parent(self) -> None:
"""Test parsing out a parent."""
ontology = _read("""\
ontology: chebi
date: 20:11:2024 18:44
[Term]
id: CHEBI:1234
is_a: CHEBI:5678
""")
term = self.get_only_term(ontology)
self.assertEqual([Reference(prefix="CHEBI", identifier="5678")], term.parents)

ontology = _read("""\
ontology: chebi
date: 20:11:2024 18:44
[Term]
id: CHEBI:1234
is_a: http://purl.obolibrary.org/obo/CHEBI_5678
""")
term = self.get_only_term(ontology)
self.assertEqual([Reference(prefix="CHEBI", identifier="5678")], term.parents)

0 comments on commit 8bb0370

Please sign in to comment.