Skip to content

Commit

Permalink
edit tests and version number
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Jun 27, 2024
1 parent b2aae88 commit 05da008
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cmem-plugin-reason"
version = "0.0.0"
version = "1.0.0alpha1"
license = "Apache-2.0"
description = "Reasoning with Robot"
authors = ["eccenca GmbH <[email protected]>"]
Expand All @@ -13,7 +13,7 @@ readme = "README-public.md"
keywords = [
"eccenca Corporate Memory", "plugin"
]
include = ["cmem_plugin_reason/bin/*"]
include = ["cmem_plugin_reason/bin/robot.jar"]

homepage = "https://github.com/eccenca/cmem-plugin-reason"

Expand Down
26 changes: 12 additions & 14 deletions tests/test_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ def _setup(request: pytest.FixtureRequest) -> None:
def tests(_setup: None) -> None:
"""Tests for reason plugin"""

def get_remote_graph(iri: str) -> Graph:
graph = Graph().parse(
data=get(iri, owl_imports_resolution=False).text,
format="turtle",
)
graph.remove((URIRef(iri), DCTERMS.created, None))
graph.remove((URIRef(iri), RDFS.label, None))
graph.remove((None, RDF.type, OWL.AnnotationProperty))
return graph

def test_reasoner(reasoner: str, err_list: list) -> list:
ReasonPlugin(
data_graph_iri=REASON_DATA_GRAPH_IRI,
Expand All @@ -70,14 +80,7 @@ def test_reasoner(reasoner: str, err_list: list) -> list:
property_assertion=True,
).execute((), context=TestExecutionContext())

result = Graph().parse(
data=get(REASON_RESULT_GRAPH_IRI, owl_imports_resolution=False).text,
format="turtle",
)
result.remove((URIRef(REASON_RESULT_GRAPH_IRI), DCTERMS.created, None))
result.remove((URIRef(REASON_RESULT_GRAPH_IRI), RDFS.label, None))
result.remove((None, RDF.type, OWL.AnnotationProperty))

result = get_remote_graph(REASON_RESULT_GRAPH_IRI)
test = Graph().parse(Path(__path__[0]) / f"test_{reasoner}.ttl", format="turtle")
if to_isomorphic(result) != to_isomorphic(test):
err_list.append(reasoner)
Expand All @@ -99,12 +102,7 @@ def test_validate(errors: str) -> str:
if not cmp(MD_FILENAME, mdfile_test):
errors += "Markdown file error ."

output_graph = Graph().parse(
data=get(OUTPUT_GRAPH_IRI, owl_imports_resolution=False).text,
)
output_graph.remove((URIRef(OUTPUT_GRAPH_IRI), DCTERMS.created, None))
output_graph.remove((URIRef(OUTPUT_GRAPH_IRI), RDFS.label, None))
output_graph.remove((None, RDF.type, OWL.AnnotationProperty))
output_graph = get_remote_graph(OUTPUT_GRAPH_IRI)
test = Graph().parse(Path(__path__[0]) / "test_validate_output.ttl", format="turtle")
if to_isomorphic(output_graph) != to_isomorphic(test):
errors += "Output graph error. "
Expand Down

0 comments on commit 05da008

Please sign in to comment.