Skip to content

Commit ae3e9df

Browse files
committed
Add test for parsing an OBO document with explicit is_a typedef
1 parent caaf6d2 commit ae3e9df

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_issues.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,24 @@ def test_class_level_clause(self):
151151
r1 = ont.create_relationship("r1")
152152
r1.class_level = True
153153
ont.dumps()
154+
155+
def test_is_a_relationship(self):
156+
"""Assert parsing a relationship named `is_a` does not crash.
157+
158+
See `#246 <https://github.com/althonos/pronto/issues/246>`_.
159+
"""
160+
161+
DATA = textwrap.dedent(
162+
"""
163+
format-version: 1.4
164+
165+
[Typedef]
166+
id: is_a
167+
name: is_a
168+
xref: RO:is_a
169+
"""
170+
)
171+
buffer = io.BytesIO(DATA.encode())
172+
with warnings.catch_warnings():
173+
warnings.simplefilter('ignore')
174+
ont = pronto.Ontology(buffer)

0 commit comments

Comments
 (0)