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

Fixed failing test_save in master #756

Merged
merged 4 commits into from
May 14, 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
24 changes: 5 additions & 19 deletions tests/test_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,12 @@ def test_save_and_copy_emmo(
assert copied_emmo == emmo


def test_save_emmo_domain_ontology(
tmpdir: "Path",
repo_dir: "Path",
) -> None:
def test_save_emmo_domain_ontology() -> None:
import os
from pathlib import Path
from ontopy.utils import directory_layout
from ontopy import get_ontology

# For debugging purposes tmpdir can be set to a directory
# in the current directory: test_save_dir
# Remember to remove the directory after testing
debug = True
if debug:
tmpdir = repo_dir / "tests" / "test_save_dir"
import os

os.makedirs(tmpdir, exist_ok=True)
from ontopy.testutils import ontodir, outdir

# This test was created with the domain-electrochemistry ontology which imports
# emmo submodules as well as chameo.
Expand All @@ -221,11 +209,9 @@ def test_save_emmo_domain_ontology(
# while emmo and chameo start with https://w3id.org/emmo/
# For faster tests a dummyontology was created.
# onto = get_ontology('https://raw.githubusercontent.com/emmo-repo/domain-electrochemistry/master/electrochemistry.ttl').load()
onto = get_ontology(
repo_dir / "tests" / "testonto" / "dummyonto_w_dummyemmo.ttl"
).load()
onto = get_ontology(ontodir / "dummyonto_w_dummyemmo.ttl").load()

outputdir = tmpdir / "saved_emmo_domain_ontology"
outputdir = outdir / "saved_emmo_domain_ontology"
savedfile = onto.save(
format="rdfxml",
dir=outputdir,
Expand All @@ -247,7 +233,7 @@ def test_save_emmo_domain_ontology(
}

# Test saving but giving filename. It should then be saved in the parent directory
outputdir2 = tmpdir / "saved_emmo_domain_ontology2"
outputdir2 = outdir / "saved_emmo_domain_ontology2"
savedfile2 = onto.save(
format="rdfxml",
dir=outputdir2,
Expand Down
Loading