Changeset 5032ea68 in sasview for src/sas/qtgui/UnitTesting/TestUtilsTest.py
- Timestamp:
- Jun 14, 2016 4:51:18 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- a281ab8
- Parents:
- 488c49d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/UnitTesting/TestUtilsTest.py
r488c49d r5032ea68 18 18 def testQtSignalSpy(self): 19 19 '''Create the Spy the correct way''' 20 test_string = 'my precious' 20 21 22 def signalReceived(signal): 23 # Test the signal callback 24 self.assertEqual(signal, test_string) 25 26 communicator = Communicate() 27 communicator.statusBarUpdateSignal.connect(signalReceived) 28 29 # Define the signal spy for testing 21 30 widget = QWidget() 22 signal = Communicate.statusBarUpdateSignal 23 self.spy = QtSignalSpy(widget, signal) 31 spy = QtSignalSpy(widget, communicator.statusBarUpdateSignal) 24 32 25 33 # Emit a signal 26 signal.emit('aa')34 communicator.statusBarUpdateSignal.emit(test_string) 27 35 28 # Test the spy object 36 # Was the signal caught by the signal spy? 37 self.assertEqual(spy.count(), 1) 29 38 30 39 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.