Skip to content

Commit

Permalink
Test for dataconverter.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder committed Apr 26, 2024
1 parent f089e20 commit 6ac6855
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/dataconverter/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from setuptools import distutils

from pynxtools.dataconverter import helpers
from pynxtools.dataconverter.helpers import set_default_group
from pynxtools.dataconverter.template import Template


Expand Down Expand Up @@ -462,6 +463,32 @@ def test_path_in_data_dict(nxdl_path, expected, template):
assert helpers.path_in_data_dict(nxdl_path, tuple(template.keys())) == expected


def test_set_default_group(template):
"""_summary_
Parameters
----------
template : Template
"""
assert (
"/@default" not in template
), "To test the root level /@default should be empty."
assert (
"/ENTRY[entry]/@default" not in template
), "To test default attribute, entry attribute should be empty."

set_default_group(template)

assert (
template["/@default"] == "entry",
"To test the root level /@default should be empty.",
)
assert (
template["/ENTRY[entry]/@default"] == "nxodd_name",
"To test default attribute, entry attribute should be empty.",
)


def test_atom_type_extractor_and_hill_conversion():
"""
Test atom type extractor and conversion to hill
Expand Down

0 comments on commit 6ac6855

Please sign in to comment.