Skip to content

Commit

Permalink
Fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Apr 2, 2024
1 parent 2cf2720 commit 162d0ba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions 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, Outputs
from nomad_simulations.outputs import Outputs, SCFOutputs


class TestBaseOutputs:
Expand All @@ -31,17 +31,17 @@ class TestBaseOutputs:
@pytest.mark.parametrize(
'is_derived, outputs_ref, result',
[
(False, BaseOutputs(), True),
(False, Outputs(), True),
(False, None, False),
(True, BaseOutputs(), True),
(True, Outputs(), True),
(True, None, None),
],
)
def test_normalize(self, is_derived, outputs_ref, result):
"""
Test the `normalize` and `check_is_derived` methods.
"""
outputs = BaseOutputs()
outputs = Outputs()
assert outputs.check_is_derived(is_derived, outputs_ref) == result
outputs.is_derived = is_derived
outputs.outputs_ref = outputs_ref
Expand All @@ -66,9 +66,9 @@ def test_normalize(self, is_converged, result):
"""
Test the `normalize` method.
"""
outputs = Outputs()
scf_outputs = SCFOutputs()
# ! This testing is repetivite, but `check_is_converged` should eventually contain more complex logic and be separated in its own testing method.
assert outputs.check_is_converged(is_converged, logger) == result
outputs.is_converged = is_converged
outputs.normalize(None, logger)
assert outputs.is_converged == result
assert scf_outputs.check_is_converged(is_converged, logger) == result
scf_outputs.is_converged = is_converged
scf_outputs.normalize(None, logger)
assert scf_outputs.is_converged == result

0 comments on commit 162d0ba

Please sign in to comment.