Changeset e540cd2 in sasview for src/sas/qtgui/UnitTesting/DataExplorerTest.py
- Timestamp:
- Jul 7, 2016 2:54: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:
- 0cd8612
- Parents:
- f0f309d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/UnitTesting/DataExplorerTest.py
r481ff26 re540cd2 92 92 self.assertIsInstance(self.form.freezeView, QTreeView) 93 93 94 94 def testWidgets(self): 95 """ 96 Test if all required widgets got added 97 """ 95 98 def testLoadButton(self): 96 99 loadButton = self.form.cmdLoad … … 111 114 112 115 # Make sure the signal has not been emitted 113 #self.assertEqual(spy_file_read.count(), 0)116 self.assertEqual(spy_file_read.count(), 0) 114 117 115 118 # Now, return a single file 116 119 QtGui.QFileDialog.getOpenFileNames = MagicMock(return_value=filename) 117 120 118 121 # Click on the Load button 119 122 QTest.mouseClick(loadButton, Qt.LeftButton) 123 QtGui.qApp.processEvents() 120 124 121 125 # Test the getOpenFileName() dialog called once … … 127 131 #self.assertIn(filename, str(spy_file_read.called()[0]['args'][0])) 128 132 133 def testLoadFiles(self): 134 """ 135 Test progress bar update while loading of multiple files 136 """ 137 # Set up the spy on progress bar update signal 138 spy_progress_bar_update = QtSignalSpy(self.form, 139 self.form.communicator.progressBarUpdateSignal) 140 141 # Populate the model 142 filename = ["cyl_400_20.txt", "Dec07031.ASC", "cyl_400_20.txt"] 143 self.form.readData(filename) 144 145 # 0, 0, 33, 66, -1 -> 5 signals reaching progressBar 146 self.assertEqual(spy_progress_bar_update.count(), 5) 147 148 expected_list = [0, 0, 33, 66, -1] 149 spied_list = [spy_progress_bar_update.called()[i]['args'][0] for i in xrange(5)] 150 self.assertEqual(expected_list, spied_list) 151 129 152 def testDeleteButton(self): 130 153 """ … … 441 464 default_list = defaults.split(';;') 442 465 443 for format in default_list:444 self.assertIn( format, w_list)466 for def_format in default_list: 467 self.assertIn(def_format, w_list) 445 468 446 469 def testLoadComplete(self):
Note: See TracChangeset
for help on using the changeset viewer.