From e0f315e1fc0d0f543ad77a3e90328d6005fc7428 Mon Sep 17 00:00:00 2001 From: "Francesca L. Bleken" <48128015+francescalb@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:09:00 +0100 Subject: [PATCH] Turned on directory layout tests for emmo and made them pytest (#706) # Description The test did not run by default. ## Type of change - [ ] Bug fix. - [ ] New feature. - [ ] Documentation update. - [ ] Test update. ## Checklist 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 --------- Co-authored-by: Jesper Friis --- tests/test_utils_directory_layout.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/test_utils_directory_layout.py b/tests/test_utils_directory_layout.py index a2b676654..0040e5f2c 100644 --- a/tests/test_utils_directory_layout.py +++ b/tests/test_utils_directory_layout.py @@ -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" @@ -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" @@ -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()