Ignore:
Timestamp:
Mar 23, 2017 7:53:10 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:
9934e48
Parents:
29eb947
Message:

FittingWidget? code review SASVIEW-561

File:
1 edited

Legend:

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

    r351b53e rb1e36a3  
    165165 
    166166        # 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) 
    168169 
    169170        # test the model combo content 
     
    190191        self.widget.show() 
    191192        # 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) 
    193195 
    194196        # check the enablement of controls 
     
    202204        self.widget.SASModelToQModel = MagicMock() 
    203205        self.widget.createDefaultDataset = MagicMock() 
    204         self.widget.calculateDataForModel = MagicMock() 
     206        self.widget.calculateQGridForModel = MagicMock() 
    205207        #  
    206208        # Now change the model 
     
    211213        self.assertTrue(self.widget.createDefaultDataset.called) 
    212214        self.assertTrue(self.widget.SASModelToQModel.called) 
    213         self.assertFalse(self.widget.calculateDataForModel.called) 
     215        self.assertFalse(self.widget.calculateQGridForModel.called) 
    214216 
    215217        # Let's set a dummy index on widget 
     
    219221        self.assertEqual(self.widget.cbModel.currentText(),'be_polyelectrolyte') 
    220222 
    221         # Observe calculateDataForModel called 
    222         self.assertTrue(self.widget.calculateDataForModel.called) 
     223        # Observe calculateQGridForModel called 
     224        self.assertTrue(self.widget.calculateQGridForModel.called) 
    223225 
    224226    def testSelectFactor(self): 
     
    228230        self.widget.show() 
    229231        # 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) 
    231234        # Change the model to one that supports structure factors 
    232235        model_index = self.widget.cbModel.findText('fractal_core_shell') 
     
    296299        # Check the index 
    297300 
    298     def testCalculateDataForModel(self): 
     301    def testCalculateQGridForModel(self): 
    299302        """ 
    300303        Check that the fitting 1D data object is ready 
     
    303306        threads.deferToThread = MagicMock() 
    304307        # Call the tested method 
    305         self.widget.calculateDataForModel() 
     308        self.widget.calculateQGridForModel() 
    306309        # Test the mock 
    307310        self.assertTrue(threads.deferToThread.called) 
     
    328331        self.widget.show() 
    329332        # 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) 
    331335        # Check the poly model 
    332336        self.assertEqual(self.widget._poly_model.rowCount(), 0) 
     
    356360        self.widget.show() 
    357361        # 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) 
    359364 
    360365        # Check the magnetic model 
     
    384389        self.widget.show() 
    385390        # 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) 
    388395 
    389396        # Assure we have the combobox available 
Note: See TracChangeset for help on using the changeset viewer.