diff --git a/tests/test_reader.py b/tests/test_reader.py index 8ff41fb1..f4c132b6 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -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)