Ejemplo n.º 1
0
 def test___init__(self):
     "check Parameter.__init__"
     p = Parameter(3, 2.2)
     self.assertEqual(3, p.idx)
     self.assertIsNone(p.refined)
     self.assertEqual(2.2, p.initialValue())
     p100 = Parameter(100, self.fitting)
     self.assertAlmostEqual(0.7957747, p100.initialValue(), 6)
     p102 = Parameter(102, "=fit-d300:102")
     self.assertAlmostEqual(1.1811493, p102.initialValue(), 6)
     self.assertRaises(ControlTypeError, Parameter, 1, None)
     return
Ejemplo n.º 2
0
 def test_initialValue(self):
     "check Parameter.initialValue"
     p1 = Parameter(1, 0.25)
     self.assertEqual(0.25, p1.initialValue())
     self.assertEqual("0.25", p1.initialStr())
     px = Parameter(7, "=undefined")
     self.assertRaises(ControlKeyError, px.initialValue)
     self.assertEqual("=undefined:7", px.initialStr())
     return