Ignore:
Timestamp:
Sep 18, 2017 6:00:01 AM (7 years ago)
Author:
celinedurniak <celine.durniak@…>
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:
8a32a6ff
Parents:
3c8242c
Message:

Fixed bug with non updated value of fitted parameter in new GUI

File:
1 edited

Legend:

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

    r8222f171 ra14a2b0  
    815815        pass 
    816816 
     817    def testOnMainPageChange(self): 
     818        """ 
     819        Test update  values of modified parameters in models 
     820        """ 
     821        # select model: cylinder / cylinder 
     822        category_index = self.widget.cbCategory.findText("Cylinder") 
     823        self.widget.cbCategory.setCurrentIndex(category_index) 
     824 
     825        model_index = self.widget.cbModel.findText("cylinder") 
     826        self.widget.cbModel.setCurrentIndex(model_index) 
     827 
     828        # modify the initial value of length (different from default) 
     829        # print self.widget.kernel_module.details['length'] 
     830 
     831        new_value = "333.0" 
     832        self.widget._model_model.item(5, 1).setText(new_value) 
     833 
     834        # name of modified parameter 
     835        name_modified_param = str(self.widget._model_model.item(5, 0).text()) 
     836 
     837        # check that the value has been modified in kernel_module 
     838        self.assertEqual(new_value, 
     839                         str(self.widget.kernel_module.params[name_modified_param])) 
     840 
     841        # check that range of variation for this parameter has NOT been changed 
     842        print self.widget.kernel_module.details[name_modified_param] 
     843        self.assertNotIn(new_value, self.widget.kernel_module.details[name_modified_param] ) 
     844 
     845 
    817846if __name__ == "__main__": 
    818847    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.