Ejemplo n.º 1
0
    def test_reset_manipulations(self):
        from libcellml import Component, Reset

        c = Component()
        r1 = Reset()
        r1.setResetValue('<math></math>')

        r2 = Reset()

        c.addReset(r1)
        c.addReset(r2)

        self.assertEqual(2, c.resetCount())
        c.removeAllResets()
        self.assertEqual(0, c.resetCount())

        c.addReset(r1)
        c.addReset(r2)

        self.assertTrue(c.removeReset(r2))

        self.assertEqual(1, c.resetCount())
        rTaken = c.takeReset(0)
        self.assertEqual(0, c.resetCount())
        self.assertEqual(r1.resetValue(), rTaken.resetValue())
Ejemplo n.º 2
0
    def test_set_get_reset_value(self):
        from libcellml import Reset

        x = Reset()
        self.assertEqual("", x.resetValue())

        x.setResetValue("A value MathML string.")

        self.assertEqual("A value MathML string.", x.resetValue())
Ejemplo n.º 3
0
    def test_clone(self):
        from libcellml import Reset

        x = Reset()
        self.assertEqual("", x.resetValue())

        x.setResetValue("A reset MathML string.")
        x.setTestValue("A test MathML string.")

        rCloned = x.clone()

        self.assertEqual("A reset MathML string.", rCloned.resetValue())
        self.assertEqual("A test MathML string.", rCloned.testValue())
Ejemplo n.º 4
0
    def test_reset_value(self):
        from libcellml import Reset

        x = Reset()
        self.assertEqual("", x.resetValue())

        x.setResetValue("A reset MathML string.")

        self.assertEqual("A reset MathML string.", x.resetValue())

        x.appendResetValue(" More MathML.")
        self.assertEqual("A reset MathML string. More MathML.", x.resetValue())

        self.assertEqual("", x.resetValueId())
        x.setResetValueId("my_reset_value")
        self.assertEqual("my_reset_value", x.resetValueId())

        x.removeResetValue()
        self.assertEqual("", x.resetValue())

        x.removeResetValueId()
        self.assertEqual("", x.resetValueId())