diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f97e073..907ca728 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.7.0 + rev: v0.8.0 hooks: # Run the linter. - id: ruff diff --git a/src/pynxtools_xps/nomad/entrypoints.py b/src/pynxtools_xps/nomad/entrypoints.py index c3565942..a4b9c948 100644 --- a/src/pynxtools_xps/nomad/entrypoints.py +++ b/src/pynxtools_xps/nomad/entrypoints.py @@ -33,5 +33,6 @@ [NXmpes](https://manual.nexusformat.org/classes/contributed_definitions/NXmpes.html#nxmpes) application definition from an example measurement file and a subseqeuent analysis of that data set. """, + plugin_package="pynxtools_xps", resources=["nomad/examples/*"], ) diff --git a/tests/test_nomad_examples.py b/tests/test_nomad_examples.py index adee1c3f..5df6be2c 100644 --- a/tests/test_nomad_examples.py +++ b/tests/test_nomad_examples.py @@ -38,33 +38,38 @@ from pynxtools_xps.nomad.entrypoints import xps_example +EXAMPLE_PATH = os.path.join( + os.path.dirname(__file__), + "..", + "src", + "pynxtools_xps", + "nomad", + "examples", +) + + @pytest.mark.parametrize( "mainfile", - get_file_parameter( - os.path.join( - os.path.dirname(__file__), "..", "src", "pynxtools_xps", "nomad", "examples" - ) - ), + get_file_parameter(EXAMPLE_PATH), ) def test_parse_nomad_examples(mainfile): """Test if NOMAD examples work.""" - parse_nomad_examples(mainfile) + archive_dict = parse_nomad_examples(mainfile) @pytest.mark.parametrize( - ("entrypoint", "expected_local_path"), + ("entrypoint", "example_path"), [ pytest.param( xps_example, - "examples/data/uploads/xps.zip", + EXAMPLE_PATH, id="xps_example", ), ], ) -def test_nomad_example_upload_entry_point_valid(entrypoint, expected_local_path): +def test_example_upload_entry_point_valid(entrypoint, example_path): """Test if NOMAD ExampleUploadEntryPoint works.""" example_upload_entry_point_valid( entrypoint=entrypoint, - plugin_package="pynxtools-xps", - expected_local_path=expected_local_path, + example_path=example_path, )