def test_float_array(self): pv = self.ioc.floatarray val = numpy.array([.0, .1, .2, .3, .4, .5, .6, .7, .8, .9, .10, .11, .12, .13, .14, .15]) pv.put(val) epics.flush() out = pv.get() self.assertAlmostEqual(val.mean(), out.mean(), 6, 'Put Failed: Values do not match')
def test_sstring(self): val = 'softdev is cool' pv = self.ioc.sstring pv.put(val) epics.flush() self.assertEqual(val, pv.get(), 'Put Failed: Values do not match: {} vs {}'.format(val, pv.get()))
def test_int_array(self): pv = self.ioc.intarray val = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] pv.put(val) epics.flush() out = pv.get() self.assertEqual(val, list(out), 'Put Failed: Values do not match')
def test_calc(self): A = self.ioc.intval B = self.ioc.floatval calc = self.ioc.calc A.put(DEFAULT_INTEGER) B.put(DEFAULT_FLOAT) epics.flush() time.sleep(2) out2 = calc.get() expected = DEFAULT_FLOAT + DEFAULT_INTEGER self.assertAlmostEqual(out2, expected, 6, 'Calculated Vaues do not match: {} vs {}'.format(out2, expected))
def test_float(self): pv = self.ioc.floatval pv.put(DEFAULT_FLOAT) epics.flush() self.assertEqual(DEFAULT_FLOAT, pv.get(), 'Put Failed: Values do not match: {} vs {}'.format(DEFAULT_FLOAT, pv.get()))
def test_integer(self): pv = self.ioc.intval pv.put(DEFAULT_INTEGER) epics.flush() self.assertEqual(DEFAULT_INTEGER, pv.get(), 'Put Failed: Values do not match: {} vs {}'.format(DEFAULT_INTEGER, pv.get()))
def test_lstring(self): val = 'softdev is cool, this is a very long string which should not fit in the small space of a regular string' pv = self.ioc.lstring pv.put(val) epics.flush() self.assertEqual(val, pv.get(), 'Put Failed: Values do not match: {} vs {}'.format(val, pv.get()))
def test_enum(self): val = 1 pv = self.ioc.enum pv.put(val) epics.flush() self.assertEqual(val, pv.get(), 'Put Failed: Values do not match: {} vs {}'.format(val, pv.get()))