Skip to content

Commit

Permalink
All feature nomad tests for pynxtools exmaples.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder committed Oct 29, 2024
1 parent 749357d commit 51e0489
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/pynxtools/testing/nomad_test_units.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import pytest
from nomad.files import DirectoryObject, StaginUploadFiles, UploadFiles


# TODO: get the example_name according the example comes from different pynxtools reader.
@pytest.mark.parametrize("example_name", ["stm"])
@pytest.fixture(scope="function")
def create_upload_id():
def create_upload_id(example_name):
"""Create upload id for test purpose."""
...
# Create os path
upload_base_dir = DirectoryObject(StaginUploadFiles.base_folder_for(example_name))

# Delete dir if the directory in that path exists already
if upload_base_dir.exists():
upload_base_dir.delete()

yield example_name
# Delete upload directory once test is done with the upload id
if upload_base_dir.exists():
upload_base_dir.delete()


@pytest.fixture(scope="function")
Expand All @@ -23,6 +36,11 @@ def test_run_processing_on_schema():
...


def test_compare_archive_json_file():
"""Compare the json file generated from yaml file."""
...


def test_nxs_file_is_generated():
"""Check if nexus file has been created."""
...
Expand Down

0 comments on commit 51e0489

Please sign in to comment.