Skip to content

Commit

Permalink
use rdflib.isomophic() in test
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Sep 25, 2024
1 parent dbc5e74 commit e9b4e7e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
46 changes: 23 additions & 23 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/test_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from cmem.cmempy.dp.proxy.graph import delete
from rdflib import Graph
from rdflib.compare import to_isomorphic
from rdflib.compare import isomorphic

from cmem_plugin_reason.plugin_reason import ReasonPlugin
from cmem_plugin_reason.utils import REASONERS
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_reasoner(reasoner: str, err_list: list) -> list:

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):
if not isomorphic(result, test):
err_list.append(reasoner)
return err_list

Expand Down
4 changes: 2 additions & 2 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from cmem.cmempy.workspace.projects.resources.resource import get_resource
from cmem_plugin_base.dataintegration.entity import Entities
from rdflib import Graph
from rdflib.compare import to_isomorphic
from rdflib.compare import isomorphic

from cmem_plugin_reason.plugin_validate import ValidatePlugin
from cmem_plugin_reason.utils import REASONERS
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_validate(reasoner: str, err_list: list) -> list:
val_errors += 'EntityPath "valid_profiles" output error. '
if md_test != get_resource(PROJECT_ID, MD_FILENAME).decode():
val_errors += "Markdown file error. "
if to_isomorphic(output_graph) != to_isomorphic(test):
if not isomorphic(output_graph, test):
val_errors += "Output graph error. "

if val_errors:
Expand Down

0 comments on commit e9b4e7e

Please sign in to comment.