Changeset b1e36a3 in sasview for src/sas/qtgui/Perspectives/Fitting/UnitTesting
- Timestamp:
- Mar 23, 2017 9:53:10 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:
- 9934e48
- Parents:
- 29eb947
- Location:
- src/sas/qtgui/Perspectives/Fitting/UnitTesting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py
r7248d75d rb1e36a3 114 114 115 115 # Test the resulting model 116 self.assertEqual(model.rowCount(), 5)116 self.assertEqual(model.rowCount(), 3) 117 117 self.assertTrue(model.item(0).isCheckable()) 118 118 self.assertEqual(model.item(0).text(), "sld_core") 119 self.assertFalse(model.item(3).hasChildren())120 119 self.assertEqual(model.item(1).text(), "radius") 121 120 self.assertEqual(model.item(2).text(), "sld_solvent") 122 self.assertEqual(model.item(3).text(), "sld1")123 124 self.assertEqual(model.item(4).text(), "thickness1")125 self.assertTrue(model.item(4).hasChildren())126 121 127 122 def testAddSimpleParametersToModel(self): … … 139 134 140 135 # Test the resulting model 141 self.assertEqual(model.rowCount(), 5)136 self.assertEqual(model.rowCount(), 3) 142 137 self.assertTrue(model.item(0).isCheckable()) 143 138 self.assertEqual(model.item(0).text(), "sld_core") -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r351b53e rb1e36a3 165 165 166 166 # invoke the method by changing the index 167 self.widget.cbCategory.setCurrentIndex(1) 167 category_index = self.widget.cbCategory.findText("Shape-Independent") 168 self.widget.cbCategory.setCurrentIndex(category_index) 168 169 169 170 # test the model combo content … … 190 191 self.widget.show() 191 192 # Change the category index so we have some models 192 self.widget.cbCategory.setCurrentIndex(1) 193 category_index = self.widget.cbCategory.findText("Shape-Independent") 194 self.widget.cbCategory.setCurrentIndex(category_index) 193 195 194 196 # check the enablement of controls … … 202 204 self.widget.SASModelToQModel = MagicMock() 203 205 self.widget.createDefaultDataset = MagicMock() 204 self.widget.calculate DataForModel = MagicMock()206 self.widget.calculateQGridForModel = MagicMock() 205 207 # 206 208 # Now change the model … … 211 213 self.assertTrue(self.widget.createDefaultDataset.called) 212 214 self.assertTrue(self.widget.SASModelToQModel.called) 213 self.assertFalse(self.widget.calculate DataForModel.called)215 self.assertFalse(self.widget.calculateQGridForModel.called) 214 216 215 217 # Let's set a dummy index on widget … … 219 221 self.assertEqual(self.widget.cbModel.currentText(),'be_polyelectrolyte') 220 222 221 # Observe calculate DataForModel called222 self.assertTrue(self.widget.calculate DataForModel.called)223 # Observe calculateQGridForModel called 224 self.assertTrue(self.widget.calculateQGridForModel.called) 223 225 224 226 def testSelectFactor(self): … … 228 230 self.widget.show() 229 231 # Change the category index so we have some models 230 self.widget.cbCategory.setCurrentIndex(1) 232 category_index = self.widget.cbCategory.findText("Shape-Independent") 233 self.widget.cbCategory.setCurrentIndex(category_index) 231 234 # Change the model to one that supports structure factors 232 235 model_index = self.widget.cbModel.findText('fractal_core_shell') … … 296 299 # Check the index 297 300 298 def testCalculate DataForModel(self):301 def testCalculateQGridForModel(self): 299 302 """ 300 303 Check that the fitting 1D data object is ready … … 303 306 threads.deferToThread = MagicMock() 304 307 # Call the tested method 305 self.widget.calculate DataForModel()308 self.widget.calculateQGridForModel() 306 309 # Test the mock 307 310 self.assertTrue(threads.deferToThread.called) … … 328 331 self.widget.show() 329 332 # Change the category index so we have a model with no poly 330 self.widget.cbCategory.setCurrentIndex(1) 333 category_index = self.widget.cbCategory.findText("Shape-Independent") 334 self.widget.cbCategory.setCurrentIndex(category_index) 331 335 # Check the poly model 332 336 self.assertEqual(self.widget._poly_model.rowCount(), 0) … … 356 360 self.widget.show() 357 361 # Change the category index so we have a model available 358 self.widget.cbCategory.setCurrentIndex(2) 362 category_index = self.widget.cbCategory.findText("Shapes") 363 self.widget.cbCategory.setCurrentIndex(category_index) 359 364 360 365 # Check the magnetic model … … 384 389 self.widget.show() 385 390 # Change the model to multi shell 386 self.widget.cbCategory.setCurrentIndex(2) 387 self.widget.cbModel.setCurrentIndex(4) 391 category_index = self.widget.cbCategory.findText("Shapes") 392 self.widget.cbCategory.setCurrentIndex(category_index) 393 model_index = self.widget.cbModel.findText("core_multi_shell") 394 self.widget.cbModel.setCurrentIndex(model_index) 388 395 389 396 # Assure we have the combobox available
Note: See TracChangeset
for help on using the changeset viewer.