- Timestamp:
- Mar 29, 2019 8:36:51 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_opencl
- Children:
- 6edd344
- Parents:
- c7e73e7
- Location:
- src/sas/qtgui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py
r8137a02 rc02721c4 186 186 # wait a bit for data to be loaded 187 187 time.sleep(0.1) 188 QtWidgets.qApp.processEvents() 189 188 190 # check updated values in ui, read from loaded file 189 191 self.assertEqual(self.widget.txtData.text(), 'sld_file.sld') … … 250 252 251 253 time.sleep(1) 254 QtWidgets.qApp.processEvents() 255 252 256 # check updated values in ui, read from loaded file 253 257 # TODO to be changed … … 310 314 self.assertEqual(self.widget.cmdLoad.text(), 'Loading...') 311 315 time.sleep(2) 316 QtWidgets.qApp.processEvents() 312 317 313 318 self.assertEqual(self.widget.txtData.text(), 'A_Raw_Example-1.omf') … … 396 401 self.assertEqual(self.widget.cmdLoad.text(), 'Loading...') 397 402 time.sleep(1) 403 QtWidgets.qApp.processEvents() 398 404 399 405 self.assertTrue(self.widget.cmdDraw.isEnabled()) … … 417 423 418 424 time.sleep(0.1) 425 QtWidgets.qApp.processEvents() 419 426 420 427 filename1 = "test" 421 428 QtWidgets.QFileDialog.getSaveFileName = MagicMock(return_value=[filename1, '']) 422 429 423 QTest.mouseClick(self.widget.cmdSave, Qt.LeftButton)430 #QTest.mouseClick(self.widget.cmdSave, Qt.LeftButton) 424 431 self.widget.onSaveFile() 432 QtWidgets.qApp.processEvents() 433 425 434 self.assertTrue(os.path.isfile(filename1 + '.sld')) 426 435 self.assertTrue(os.path.getsize(filename1 + '.sld') > 0) -
src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py
r9ce69ec rc02721c4 128 128 129 129 # Assure the mass density field is set 130 #self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '43.4')131 130 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '2.89') 132 133 # Reset the widget134 self.widget.modelReset()135 136 self.assertEqual(self.widget.ui.editMolecularFormula.text(), "H2O")137 self.assertEqual(self.widget.ui.editMassDensity.text(), "1")138 self.assertEqual(self.widget.ui.editWavelength.text(), "6")139 131 140 132 def testHelp(self): -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
r0989bad rc02721c4 740 740 caption="Save As", 741 741 directory='cyl_400_20_out.txt', 742 filter='Text files (*.txt);;CanSAS 1D files(*.xml) ',742 filter='Text files (*.txt);;CanSAS 1D files(*.xml);;NXcanSAS files (*.h5)', 743 743 parent=None) 744 744 QFileDialog.getSaveFileName.assert_called_once() … … 763 763 caption="Save As", 764 764 directory='P123_D2O_10_percent_out.dat', 765 filter='IGOR/DAT 2D file in Q_map (*.dat) ',765 filter='IGOR/DAT 2D file in Q_map (*.dat);;NXcanSAS files (*.h5)', 766 766 parent=None) 767 767 QFileDialog.getSaveFileName.assert_called_once() -
src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py
r0989bad rc02721c4 147 147 """ 148 148 self.manager.processVersion = MagicMock() 149 version = {'version' : '4.2. 0',149 version = {'version' : '4.2.1', 150 150 'update_url' : 'http://www.sasview.org/sasview.latestversion', 151 151 'download_url': 'https://github.com/SasView/sasview/releases'} -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r0989bad rc02721c4 242 242 self.widget.show() 243 243 # Change the category index so we have some models 244 category_index = self.widget.cbCategory.findText(" Shape Independent")244 category_index = self.widget.cbCategory.findText("Cylinder") 245 245 self.widget.cbCategory.setCurrentIndex(category_index) 246 246 # Change the model to one that supports structure factors 247 model_index = self.widget.cbModel.findText(' fractal_core_shell')247 model_index = self.widget.cbModel.findText('cylinder') 248 248 self.widget.cbModel.setCurrentIndex(model_index) 249 249 … … 260 260 self.widget.cbStructureFactor.setCurrentIndex(structure_index) 261 261 262 # We have 3 more param rows now (radius_effective is removed), and a new heading263 self.assertEqual(self.widget._model_model.rowCount(), rowcount+ 4)262 # We have 3 more param rows now (radius_effective is removed), and new headings 263 self.assertEqual(self.widget._model_model.rowCount(), rowcount+7) 264 264 265 265 # Switch models -
src/sas/qtgui/Utilities/UnitTesting/TabbedModelEditorTest.py
r80468f6 rc02721c4 204 204 self.widget.editor_widget.txtEditor.toPlainText = MagicMock(return_value=boring_text) 205 205 self.widget.writeFile = MagicMock() 206 self.widget.plugin_widget.is_python = MagicMock() 206 207 #invoke the method 207 208 self.widget.updateFromEditor()
Note: See TracChangeset
for help on using the changeset viewer.