Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test_experiment_step_termination.py*** #3800

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 8 additions & 9 deletions tests/unit/test_experiments/test_experiment_step_termination.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#
# Test the experiment step termination classes
#

import pybamm
import unittest
import pytest


class TestExperimentStepTermination(unittest.TestCase):
class TestExperimentStepTermination:
def test_base_termination(self):
term = pybamm.step.BaseTermination(1)
self.assertEqual(term.value, 1)

with self.assertRaises(NotImplementedError):
assert term.value == 1
with pytest.raises(NotImplementedError):
term.get_event(None, None)

self.assertEqual(term, pybamm.step.BaseTermination(1))
self.assertNotEqual(term, pybamm.step.BaseTermination(2))
self.assertNotEqual(term, pybamm.step.CurrentTermination(1))
assert term == pybamm.step.BaseTermination(1)
assert term != pybamm.step.BaseTermination(2)
assert term != pybamm.step.CurrentTermination(1)