Changeset 9208346 in sasview
- Timestamp:
- Apr 9, 2017 6:16:37 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:
- 9687d58
- Parents:
- 1970780
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py
r6fd4e36 r9208346 97 97 barbell_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 98 98 99 model = QtGui.QStandardItemModel() 100 101 FittingUtilities.addParametersToModel(barbell_parameters, model) 99 params = FittingUtilities.addParametersToModel(barbell_parameters, True) 102 100 103 101 # Test the resulting model 104 self.assertEqual(model.rowCount(), 5) 105 self.assertTrue(model.item(0).isCheckable()) 106 self.assertEqual(model.item(0).text(), "sld") 107 self.assertEqual(model.item(1).text(), "sld_solvent") 102 self.assertEqual(len(params), 7) 103 self.assertEqual(len(params[0]), 5) 104 self.assertTrue(params[0][0].isCheckable()) 105 self.assertEqual(params[0][0].text(), "sld") 106 self.assertEqual(params[1][0].text(), "sld_solvent") 108 107 109 108 # Use a multi-shell parameter to see that the method includes shell params … … 112 111 multi_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 113 112 114 model = QtGui.QStandardItemModel() 115 116 FittingUtilities.addParametersToModel(multi_parameters, model) 113 params = FittingUtilities.addParametersToModel(multi_parameters, False) 117 114 118 115 # Test the resulting model 119 self.assertEqual( model.rowCount(), 3)120 self.assert True(model.item(0).isCheckable())121 self.assert Equal(model.item(0).text(), "sld_core")122 self.assertEqual( model.item(1).text(), "radius")123 self.assertEqual( model.item(2).text(), "sld_solvent")116 self.assertEqual(len(params), 3) 117 self.assertEqual(len(params[0]), 5) 118 self.assertTrue(params[0][0].isCheckable()) 119 self.assertEqual(params[0][0].text(), "sld_core") 120 self.assertEqual(params[1][0].text(), "radius") 124 121 125 122 def testAddSimpleParametersToModel(self): … … 132 129 multi_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 133 130 134 model = QtGui.QStandardItemModel() 135 136 FittingUtilities.addParametersToModel(multi_parameters, model) 131 params = FittingUtilities.addParametersToModel(multi_parameters, True) 137 132 138 133 # Test the resulting model 139 self.assertEqual(model.rowCount(), 3) 140 self.assertTrue(model.item(0).isCheckable()) 141 self.assertEqual(model.item(0).text(), "sld_core") 142 self.assertEqual(model.item(1).text(), "radius") 134 self.assertEqual(len(params), 3) 135 self.assertEqual(len(params[0]), 5) 136 self.assertTrue(params[0][0].isCheckable()) 137 self.assertEqual(params[0][0].text(), "sld_core") 138 self.assertEqual(params[1][0].text(), "radius") 143 139 144 140 def testAddCheckedListToModel(self):
Note: See TracChangeset
for help on using the changeset viewer.