Changeset 6edd344 in sasview


Ignore:
Timestamp:
Mar 29, 2019 12:11:34 PM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_opencl
Children:
7a1481f
Parents:
c02721c4
Message:

More unit test fixes.

Location:
src/sas/qtgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py

    rc02721c4 r6edd344  
    1313 
    1414# Local 
    15 from sas.qtgui.Calculators.SldPanel import SldResult 
     15#from sas.qtgui.Calculators.SldPanel import SldResult 
    1616from sas.qtgui.Calculators.SldPanel import SldPanel 
    17 from sas.qtgui.Calculators.SldPanel import sldAlgorithm 
     17from sas.qtgui.Calculators.SldPanel import neutronSldAlgorithm, xraySldAlgorithm 
    1818from sas.qtgui.Utilities.GuiUtils import FormulaValidator 
    1919 
     
    2222if not QtWidgets.QApplication.instance(): 
    2323    app = QtWidgets.QApplication(sys.argv) 
    24  
    25 class SldResultTest(unittest.TestCase): 
    26     """ Test the simple container class""" 
    27     def testObjectSize(self): 
    28         results = SldResult(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
    29                             0.0, 0.0, 0.0, 0.0, 0.0, 0.0) 
    30         self.assertEqual(sys.getsizeof(results), 56) 
    3124 
    3225 
     
    3831        wavelength = 6.0 
    3932         
    40         results = sldAlgorithm( molecular_formula, 
     33        results = neutronSldAlgorithm( molecular_formula, 
    4134                                mass_density, 
    4235                                wavelength) 
    43         self.assertIsInstance(results, SldResult) 
     36        #self.assertIsInstance(results, SldResult) 
    4437        self.assertAlmostEqual(results.neutron_length, 0.175463, 5) 
    4538        self.assertAlmostEqual(results.neutron_inc_xs, 5.365857, 5) 
     
    5144        wavelength = 666.0 
    5245         
    53         results = sldAlgorithm( molecular_formula, 
     46        results = neutronSldAlgorithm( molecular_formula, 
    5447                                mass_density, 
    5548                                wavelength) 
    56         self.assertIsInstance(results, SldResult) 
     49        #self.assertIsInstance(results, SldResult) 
    5750        self.assertAlmostEqual(results.neutron_length,   0.059402, 5) 
    5851        self.assertAlmostEqual(results.neutron_inc_xs,   0.145427, 5) 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    rc02721c4 r6edd344  
    205205        model_index = self.widget.cbModel.findText("be_polyelectrolyte") 
    206206        self.widget.cbModel.setCurrentIndex(model_index) 
     207        QtWidgets.qApp.processEvents() 
    207208 
    208209        # check the enablement of controls 
     
    12291230        model_index = self.widget.cbModel.findText("pringle") 
    12301231        self.widget.cbModel.setCurrentIndex(model_index) 
     1232        QtWidgets.qApp.processEvents() 
    12311233 
    12321234        # make sure the parameters are different than before 
  • src/sas/qtgui/Plotting/Plotter.py

    rb016f17 r6edd344  
    220220        Resize the legend window/font on canvas resize 
    221221        """ 
     222        if not self.showLegend: 
     223            return 
    222224        width = _legendResize(event.width) 
    223225        # resize the legend to follow the canvas width. 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    r0989bad r6edd344  
    409409 
    410410        # Replace data in plot 
    411         self.plotter.replacePlot(1, data2) 
     411        self.plotter.replacePlot("Test name", data2) 
    412412 
    413413        # See that the labels changed 
Note: See TracChangeset for help on using the changeset viewer.