Beispiel #1
0
    def test_DoubleVal(self):
        pvn = pvnames.double_pv
        chid = ca.create_channel(pvn, connect=True)
        cdict = ca.get_ctrlvars(chid)
        write('CA testing CTRL Values for a Double (%s)' % (pvn))
        self.failUnless('units' in cdict)
        self.failUnless('precision' in cdict)
        self.failUnless('severity' in cdict)

        hostname = ca.host_name(chid)
        self.failUnless(len(hostname) > 1)

        count = ca.element_count(chid)
        self.assertEqual(count, 1)

        ftype = ca.field_type(chid)
        self.assertEqual(ftype, ca.dbr.DOUBLE)

        prec = ca.get_precision(chid)
        self.assertEqual(prec, pvnames.double_pv_prec)

        units = ca.BYTES2STR(ca.get_ctrlvars(chid)['units'])
        self.assertEqual(units, pvnames.double_pv_units)

        rwacc = ca.access(chid)
        self.failUnless(rwacc.startswith('read'))
Beispiel #2
0
 def test_DoubleVal(self):
     pvn = pvnames.double_pv
     pv = PV(pvn)
     pv.get()
     cdict = pv.get_ctrlvars()
     write('Testing CTRL Values for a Double (%s)\n' % (pvn))
     self.failUnless('severity' in cdict)
     self.failUnless(len(pv.host) > 1)
     self.assertEqual(pv.count, 1)
     self.assertEqual(pv.precision, pvnames.double_pv_prec)
     units = ca.BYTES2STR(pv.units)
     self.assertEqual(units, pvnames.double_pv_units)
     self.failUnless(pv.access.startswith('read'))