Changeset 9208346 in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Apr 9, 2017 6:16:37 AM (8 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:
9687d58
Parents:
1970780
Message:

Fix failing unit tests

File:
1 edited

Legend:

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

    r6fd4e36 r9208346  
    9797        barbell_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 
    9898 
    99         model = QtGui.QStandardItemModel() 
    100  
    101         FittingUtilities.addParametersToModel(barbell_parameters, model) 
     99        params = FittingUtilities.addParametersToModel(barbell_parameters, True) 
    102100 
    103101        # 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") 
    108107 
    109108        # Use a multi-shell parameter to see that the method includes shell params 
     
    112111        multi_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 
    113112 
    114         model = QtGui.QStandardItemModel() 
    115  
    116         FittingUtilities.addParametersToModel(multi_parameters, model) 
     113        params = FittingUtilities.addParametersToModel(multi_parameters, False) 
    117114 
    118115        # Test the resulting model 
    119         self.assertEqual(model.rowCount(), 3) 
    120         self.assertTrue(model.item(0).isCheckable()) 
    121         self.assertEqual(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") 
    124121 
    125122    def testAddSimpleParametersToModel(self): 
     
    132129        multi_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 
    133130 
    134         model = QtGui.QStandardItemModel() 
    135  
    136         FittingUtilities.addParametersToModel(multi_parameters, model) 
     131        params = FittingUtilities.addParametersToModel(multi_parameters, True) 
    137132 
    138133        # 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") 
    143139 
    144140    def testAddCheckedListToModel(self): 
Note: See TracChangeset for help on using the changeset viewer.