fix test vocab namespace #47
GitHub Actions / JUnit Test Report
failed
Sep 23, 2024 in 0s
3 tests run, 2 passed, 0 skipped, 1 failed.
Annotations
Check failure on line 64 in .mypy_cache/3.11/tests/test_shapes.data.json
github-actions / JUnit Test Report
test_shapes.test_workflow_execution
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/cmem-plugin-shapes/cmem-plugin-shapes/tests/test_shapes.ttl'
Raw output
_setup = None
@needs_cmem
def test_workflow_execution(_setup: pytest.FixtureRequest) -> None: # noqa: PT019
"""Test plugin execution"""
ShapesPlugin(
data_graph_iri=DATA_IRI,
shapes_graph_iri=RESULT_IRI,
overwrite=False,
import_shapes=True,
).execute(inputs=None, context=TestExecutionContext(project_id=PROJECT_NAME))
result = Graph().parse(data=get(RESULT_IRI, owl_imports_resolution=False).text)
> test = Graph().parse(Path(__path__[0]) / "test_shapes.ttl", format="turtle")
tests/test_shapes.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.11/site-packages/rdflib/graph.py:1470: in parse
source = create_input_source(
.venv/lib/python3.11/site-packages/rdflib/parser.py:416: in create_input_source
) = _create_input_source_from_location(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = None, format = 'turtle', input_source = None
location = '/home/runner/work/cmem-plugin-shapes/cmem-plugin-shapes/tests/test_shapes.ttl'
def _create_input_source_from_location(
file: Optional[Union[BinaryIO, TextIO]],
format: Optional[str],
input_source: Optional[InputSource],
location: str,
) -> Tuple[URIRef, bool, Optional[Union[BinaryIO, TextIO]], Optional[InputSource]]:
# Fix for Windows problem https://github.com/RDFLib/rdflib/issues/145 and
# https://github.com/RDFLib/rdflib/issues/1430
# NOTE: using pathlib.Path.exists on a URL fails on windows as it is not a
# valid path. However os.path.exists() returns false for a URL on windows
# which is why it is being used instead.
if os.path.exists(location):
location = pathlib.Path(location).absolute().as_uri()
base = pathlib.Path.cwd().as_uri()
absolute_location = URIRef(rdflib.util._iri2uri(location), base=base)
if absolute_location.startswith("file:///"):
filename = url2pathname(absolute_location.replace("file:///", "/"))
> file = open(filename, "rb")
E FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/cmem-plugin-shapes/cmem-plugin-shapes/tests/test_shapes.ttl'
.venv/lib/python3.11/site-packages/rdflib/parser.py:476: FileNotFoundError
Loading