Skip to content

Commit

Permalink
✅ Clean up test properly (#161)
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <lukas.heumos@posteo.net>
  • Loading branch information
Zethson authored Nov 15, 2024
1 parent d0fd679 commit 05941d9
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/test_ontology.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
from pathlib import Path

import bionty.base as bt_base
from bionty.base.dev._io import s3_bionty_assets


def test_ontology():
localpath = s3_bionty_assets("ontology_all__pw__7.79__Pathway")
onto = bt_base.Ontology(localpath)
assert onto.get_term("PW:0000014").name == "neurodegenerative pathway"
df = onto.to_df(source="pw", include_id_prefixes={"pw": ["PW"]})
assert df.shape == (2647, 4)
assert df.index.name == "ontology_id"

try:
onto = bt_base.Ontology(localpath)
assert onto.get_term("PW:0000014").name == "neurodegenerative pathway"

df = onto.to_df(source="pw", include_id_prefixes={"pw": ["PW"]})
assert df.shape == (2647, 4)
assert df.index.name == "ontology_id"

finally:
if Path(localpath).exists:
Path(localpath).unlink()

0 comments on commit 05941d9

Please # to comment.