Skip to content

Commit

Permalink
TEST: Create a new PV for 2nd caget in TestEnumUndefinedTimestamp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bhill-slac committed Jun 9, 2022
1 parent 75a3e67 commit dac2854
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions testTop/pyTestsApp/TestEnumUndefinedTimestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,28 @@ def testUndefTimestamp(self):
'''Two caget on an mbbi - both timestamps should be defined.'''
iocPV = epics.PV("ioc:HUGO:ENUM", auto_monitor=None)
iocPV.add_callback(self.onChangeIOC)
gwPV = epics.PV("gateway:HUGO:ENUM", auto_monitor=None)
gwPV.add_callback(self.onChangeGW)
gwPV1 = epics.PV("gateway:HUGO:ENUM", auto_monitor=None)
gwPV1.add_callback(self.onChangeGW)
iocEnumValue = iocPV.get()
gwEnumValue = gwPV.get()
gwEnumValue = gwPV1.get()

# Verify timestamp and value match
self.assertTrue( iocEnumValue == gwEnumValue,
'ioc enum {0} !=\ngw enum {1}'.format( iocEnumValue, gwEnumValue ) )

# Close current CA context and open a new one
epics.ca.detach_context()
epics.ca.create_context()

'''Two caget on an mbbi - both timestamps should be defined.'''
# Now get the gateway value again and make sure the timestamp is not undefined
gwPV.get()
gwPV2 = epics.PV("gateway:HUGO:ENUM", auto_monitor=None)
gwPV2.add_callback(self.onChangeGW)
gwEnumValue = gwPV2.get()
if iocPV.status != epics.dbr.AlarmStatus.UDF:
self.assertTrue( gwPV.status != epics.dbr.AlarmStatus.UDF,
self.assertTrue( gwPV2.status != epics.dbr.AlarmStatus.UDF,
'2nd CA get is undefined!' )
self.assertTrue( gwPV.timestamp != 0, '2nd CA get timestamp is undefined!' )
self.assertTrue( gwPV2.timestamp != 0, '2nd CA get timestamp is undefined!' )
self.assertTrue( iocEnumValue == gwEnumValue,
'ioc enum {0} !=\ngw enum {1}'.format( iocEnumValue, gwEnumValue ) )

Expand Down

0 comments on commit dac2854

Please sign in to comment.