Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turned on directory layout tests for emmo and made them pytest #706

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions tests/test_utils_directory_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from ontopy.utils import directory_layout


# Requires that we have EMMO checked out locally
if False:
emmo = get_ontology("../EMMO/emmo.ttl").load()
def test_emmo_directory_layout():
emmo = get_ontology(
"https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta4/emmo.ttl"
).load()
layout = directory_layout(emmo)

# Map base IRIs to ontologies for easy access to all sub-ontologies
omap = {o.base_iri: o for o in layout.keys()}

# Base IRI of EMMO should not end with slash (/) !!!
assert layout[omap["http://emmo.info/emmo/"]] == "emmo"

Expand All @@ -32,10 +32,6 @@
layout[omap["http://emmo.info/emmo/disciplines/math#"]]
== "disciplines/math"
)
assert (
layout[omap["http://emmo.info/emmo/disciplines/units/siunits#"]]
== "disciplines/units/siunits"
)
assert (
layout[omap["http://emmo.info/emmo/mereocausality#"]]
== "mereocausality/mereocausality"
Expand All @@ -60,17 +56,13 @@
layout[omap["http://emmo.info/emmo/disciplines/math#"]]
== "disciplines/math"
)
assert (
layout[omap["http://emmo.info/emmo/disciplines/units/siunits#"]]
== "disciplines/units/siunits"
)
assert (
layout[omap["http://emmo.info/emmo/mereocausality#"]]
== "mereocausality/mereocausality"
)


if True:
def test_local_directory_layout():
thisdir = Path(__file__).resolve().parent
ontopath = thisdir / "testonto" / "testonto.ttl"
onto = get_ontology(ontopath).load()
Expand Down