Skip to content

Commit

Permalink
Turned on directory layout tests for emmo and made them pytest (#706)
Browse files Browse the repository at this point in the history
# Description
The test did not run by default.

## Type of change
<!-- Put an `x` in the box that applies. -->
- [ ] Bug fix.
- [ ] New feature.
- [ ] Documentation update.
- [ ] Test update.

## Checklist
<!-- Put an `x` in the boxes that apply. You can also fill these out
after creating the PR. -->

This checklist can be used as a help for the reviewer.

- [ ] Is the code easy to read and understand?
- [ ] Are comments for humans to read, not computers to disregard?
- [ ] Does a new feature has an accompanying new test (in the CI or unit
testing schemes)?
- [ ] Has the documentation been updated as necessary?
- [ ] Does this close the issue?
- [ ] Is the change limited to the issue?
- [ ] Are errors handled for all outcomes?
- [ ] Does the new feature provide new restrictions on dependencies, and
if so is this documented?

## Comments
<!-- Additional comments here, including clarifications on checklist if
applicable. -->

---------

Co-authored-by: Jesper Friis <jesper-friis@users.noreply.github.com>
  • Loading branch information
francescalb and jesper-friis authored Jan 24, 2024
1 parent 8ffe31b commit e0f315e
Showing 1 changed file with 5 additions and 13 deletions.
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

0 comments on commit e0f315e

Please sign in to comment.