Skip to content

Commit

Permalink
Add test for Outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Apr 2, 2024
1 parent f815028 commit 42f1d67
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from . import logger

from nomad_simulations.outputs import BaseOutputs
from nomad_simulations.outputs import BaseOutputs, Outputs


class TestBaseOutputs:
Expand Down Expand Up @@ -48,3 +48,26 @@ def test_normalize(self, is_derived, outputs_ref, result):
outputs.normalize(None, logger)
if result is not None:
assert outputs.is_derived == result


class TestOutputs:
"""
Test the `Outputs` class defined in `outputs.py`.
"""

@pytest.mark.parametrize(
'is_converged, result',
[
(False, False),
(True, True),
],
)
def test_normalize(self, is_converged, result):
"""
Test the `normalize` method.
"""
outputs = Outputs()
assert outputs.check_is_converged(is_converged, logger) == result
outputs.is_converged = is_converged
outputs.normalize(None, logger)
assert outputs.is_converged == result

0 comments on commit 42f1d67

Please sign in to comment.