Beispiel #1
0
class IStepStateTest(TestCase):
    def setUp(self):
        self._default = IStepState()

    def test_on_done_finalizes_solution(self):
        self.assertFalse(self._default.solution.finalized)
        self._default.done()
        self.assertTrue(self._default.solution.finalized)

    def test_proxies_time_point(self):
        self._default.solution.time_point = 1.0
        self.assertIs(self._default.time_point, 1.0)

    def test_provides_delta_tau(self):
        self.assertEqual(self._default.delta_tau, 0.0)

        self._default.delta_tau = 0.1
        self.assertIs(self._default.delta_tau, 0.1)

        with self.assertRaises(ValueError):
            self._default.delta_tau = -0.1
Beispiel #2
0
 def setUp(self):
     self._default = IStepState()