Ignore:
Timestamp:
May 18, 2017 7:05:27 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
6964d44
Parents:
6066a3f
Message:

Fixes for structure factor chooser + minor refactoring in the FittingWidget?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    rdc5ef15 rfd1ae6d1  
    219219        self.assertEqual(self.widget.cbStructureFactor.currentText(), STRUCTURE_DEFAULT) 
    220220 
    221  
    222         # TODO once functionality fixed 
    223         ## Switch category to structure factor 
    224         #structure_index=self.widget.cbCategory.findText(CATEGORY_STRUCTURE) 
    225         #self.widget.cbCategory.setCurrentIndex(structure_index) 
    226         ## Choose the last factor 
    227         #last_index = self.widget.cbStructureFactor.count() 
    228         #self.widget.cbStructureFactor.setCurrentIndex(last_index-1) 
     221        # Switch category to structure factor 
     222        structure_index=self.widget.cbCategory.findText(CATEGORY_STRUCTURE) 
     223        self.widget.cbCategory.setCurrentIndex(structure_index) 
     224        # Observe the correct enablement 
     225        self.assertTrue(self.widget.cbStructureFactor.isEnabled()) 
     226        self.assertFalse(self.widget.cbModel.isEnabled()) 
     227        self.assertEqual(self.widget._model_model.rowCount(), 0) 
     228 
     229        # Choose the last factor 
     230        last_index = self.widget.cbStructureFactor.count() 
     231        self.widget.cbStructureFactor.setCurrentIndex(last_index-1) 
     232        # Do we have all the rows? 
     233        self.assertEqual(self.widget._model_model.rowCount(), 4) 
     234 
     235        # Are the command buttons properly enabled? 
     236        self.assertTrue(self.widget.cmdPlot.isEnabled()) 
     237        self.assertFalse(self.widget.cmdFit.isEnabled()) 
    229238 
    230239    def testReadCategoryInfo(self): 
Note: See TracChangeset for help on using the changeset viewer.