Changeset 676f137 in sasview for src/sas/qtgui/Perspectives/Fitting/UnitTesting
- Timestamp:
- Jan 11, 2018 8:04:58 AM (7 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:
- be8f4b0
- Parents:
- 570e091
- Location:
- src/sas/qtgui/Perspectives/Fitting/UnitTesting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py
r53c771e r676f137 44 44 self.assertEqual(len(self.widget.tabs), 1) 45 45 self.assertEqual(self.widget.maxIndex, 1) 46 self.assertEqual(self.widget.tabName(), "FitPage1") 46 self.assertEqual(self.widget.maxCSIndex, 0) 47 self.assertEqual(self.widget.getTabName(), "FitPage1") 47 48 48 49 def testAddTab(self): … … 52 53 self.widget.addFit(None) 53 54 self.assertEqual(len(self.widget.tabs), 2) 54 self.assertEqual(self.widget. tabName(), "FitPage2")55 self.assertEqual(self.widget.getTabName(), "FitPage2") 55 56 self.assertEqual(self.widget.maxIndex, 2) 56 57 # Add an empty batch tab 57 58 self.widget.addFit(None, is_batch=True) 58 59 self.assertEqual(len(self.widget.tabs), 3) 59 self.assertEqual(self.widget. tabName(2), "BatchPage3")60 self.assertEqual(self.widget.getTabName(2), "BatchPage3") 60 61 self.assertEqual(self.widget.maxIndex, 3) 62 63 def testAddCSTab(self): 64 ''' Add a constraint/simult tab''' 65 self.widget.addConstraintTab() 66 self.assertEqual(len(self.widget.tabs), 2) 67 self.assertEqual(self.widget.getCSTabName(), "Const. & Simul. Fit1") 68 self.assertEqual(self.widget.maxCSIndex, 1) 61 69 62 70 def testResetTab(self): 63 71 ''' Remove data from last tab''' 64 72 self.assertEqual(len(self.widget.tabs), 1) 65 self.assertEqual(self.widget. tabName(), "FitPage1")73 self.assertEqual(self.widget.getTabName(), "FitPage1") 66 74 self.assertEqual(self.widget.maxIndex, 1) 67 75 … … 71 79 # see that the tab didn't disappear, just changed the name/id 72 80 self.assertEqual(len(self.widget.tabs), 1) 73 self.assertEqual(self.widget. tabName(), "FitPage2")81 self.assertEqual(self.widget.getTabName(), "FitPage2") 74 82 self.assertEqual(self.widget.maxIndex, 2) 75 83 … … 95 103 self.assertEqual(len(self.widget.tabs), 1) 96 104 self.assertEqual(self.widget.maxIndex, 2) 97 self.assertEqual(self.widget. tabName(), "FitPage2")105 self.assertEqual(self.widget.getTabName(), "FitPage2") 98 106 99 107 # Attemtp to remove the last tab … … 102 110 self.assertEqual(len(self.widget.tabs), 1) 103 111 self.assertEqual(self.widget.maxIndex, 3) 104 self.assertEqual(self.widget. tabName(), "FitPage3")112 self.assertEqual(self.widget.getTabName(), "FitPage3") 105 113 106 114 def testAllowBatch(self): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
- Property mode changed from 100755 to 100644
r53c771e r676f137 112 112 fittingWindow = self.widget 113 113 114 self.assertIsInstance(fittingWindow.lstMagnetic.itemDelegate(), Qt Gui.QStyledItemDelegate)114 self.assertIsInstance(fittingWindow.lstMagnetic.itemDelegate(), QtWidgets.QStyledItemDelegate) 115 115 #Test loading from json categories 116 116 fittingWindow.SASModelToQModel("cylinder") 117 117 mag_index = fittingWindow.lstMagnetic.model().index(0,0) 118 self.assertEqual( str(mag_index.data().toString()), "up:frac_i")118 self.assertEqual(mag_index.data(), "up:frac_i") 119 119 mag_index = fittingWindow.lstMagnetic.model().index(1,0) 120 self.assertEqual( str(mag_index.data().toString()), "up:frac_f")120 self.assertEqual(mag_index.data(), "up:frac_f") 121 121 mag_index = fittingWindow.lstMagnetic.model().index(2,0) 122 self.assertEqual( str(mag_index.data().toString()), "up:angle")122 self.assertEqual(mag_index.data(), "up:angle") 123 123 mag_index = fittingWindow.lstMagnetic.model().index(3,0) 124 self.assertEqual( str(mag_index.data().toString()), "M0:sld")124 self.assertEqual(mag_index.data(), "M0:sld") 125 125 mag_index = fittingWindow.lstMagnetic.model().index(4,0) 126 self.assertEqual( str(mag_index.data().toString()), "mtheta:sld")126 self.assertEqual(mag_index.data(), "mtheta:sld") 127 127 mag_index = fittingWindow.lstMagnetic.model().index(5,0) 128 self.assertEqual( str(mag_index.data().toString()), "mphi:sld")128 self.assertEqual(mag_index.data(), "mphi:sld") 129 129 mag_index = fittingWindow.lstMagnetic.model().index(6,0) 130 self.assertEqual( str(mag_index.data().toString()), "M0:sld_solvent")130 self.assertEqual(mag_index.data(), "M0:sld_solvent") 131 131 mag_index = fittingWindow.lstMagnetic.model().index(7,0) 132 self.assertEqual( str(mag_index.data().toString()), "mtheta:sld_solvent")132 self.assertEqual(mag_index.data(), "mtheta:sld_solvent") 133 133 mag_index = fittingWindow.lstMagnetic.model().index(8,0) 134 self.assertEqual( str(mag_index.data().toString()), "mphi:sld_solvent")134 self.assertEqual(mag_index.data(), "mphi:sld_solvent") 135 135 136 136 # test the delegate a bit 137 137 delegate = fittingWindow.lstMagnetic.itemDelegate() 138 138 self.assertEqual(delegate.editableParameters(), [1, 2, 3]) 139 self.assertIsInstance(delegate.combo_updated, QtCore.pyqtBoundSignal)140 139 141 140 def testSelectStructureFactor(self):
Note: See TracChangeset
for help on using the changeset viewer.