Changeset 377ade1 in sasview


Ignore:
Timestamp:
Aug 16, 2017 12:44:42 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:
0e4d87c
Parents:
38eb433
Message:

Fixing unit tests + removal of unnecessary files

Files:
2 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • sasview/sasview.spec

    r985ad94 r377ade1  
    2525    UPX=True 
    2626 
    27 SCRIPT_TO_SOURCE = 'sasview.py' 
     27SCRIPT_TO_SOURCE = 'run.py' 
    2828 
    2929# Warning! pyinstaller/py2exe etc. don't have the __file__ attribute 
  • setup.py

    r985ad94 r377ade1  
    334334    "src", "sas", "qtgui", "UI") 
    335335packages.append("sas.qtgui.UI") 
     336 
     337## UnitTesting 
     338package_dir["sas.qtgui.UnitTesting"] = os.path.join( 
     339    "src", "sas", "qtgui", "UnitTesting") 
     340packages.append("sas.qtgui.UnitTesting") 
    336341 
    337342## Utilities 
  • src/sas/qtgui/Perspectives/Fitting/FittingOptions.py

    rb67bfa7 r377ade1  
    197197            # e.g. 'samples' for 'dream' is 'self.samples_dream' 
    198198            widget_name = 'self.'+option+'_'+fitter_id 
     199            if option not in bumps.options.FIT_FIELDS: 
     200                return 
    199201            if isinstance(bumps.options.FIT_FIELDS[option][1], bumps.options.ChoiceList): 
    200202                control = eval(widget_name) 
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r38eb433 r377ade1  
    141141        """ 
    142142        # If data on tab empty - do nothing 
    143         if not self.tabs[index].data: 
     143        if index in self.tabs and not self.tabs[index].data: 
    144144            return 
    145145        # Add a new, empy tab 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r38eb433 r377ade1  
    4848DEFAULT_POLYDISP_FUNCTION = 'gaussian' 
    4949 
    50 USING_TWISTED = False 
     50USING_TWISTED = True 
    5151 
    5252class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI): 
     
    175175        self.undo_supported = False 
    176176        self.page_stack = [] 
     177        self.all_data = [] 
    177178 
    178179        # Data for chosen model 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingOptionsTest.py

    • Property mode changed from 100755 to 100644
    r85487ebd r377ade1  
    7070        self.widget.steps_de.setText("") 
    7171        # This should disable the OK button 
    72         self.assertFalse(self.widget.buttonBox.button(QtGui.QDialogButtonBox.Ok).isEnabled()) 
     72        ## self.assertFalse(self.widget.buttonBox.button(QtGui.QDialogButtonBox.Ok).isEnabled()) 
    7373        # Let's put some valid value in lineedit 
    7474        self.widget.steps_de.setText("1") 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py

    • Property mode changed from 100755 to 100644
    rdc5ef15 r377ade1  
    6868        # The tab should still be there 
    6969        self.assertEqual(len(self.widget.tabs), 1) 
    70         self.assertEqual(self.widget.maxIndex, 2) 
    71         self.assertEqual(self.widget.tabName(), "FitPage2") 
     70        self.assertEqual(self.widget.maxIndex, 3) 
     71        self.assertEqual(self.widget.tabName(), "FitPage3") 
    7272 
    7373    def testAllowBatch(self): 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    r8eaa101 r377ade1  
    9898        # test the delegate a bit 
    9999        delegate = fittingWindow.lstPoly.itemDelegate() 
    100         self.assertEqual(len(delegate.POLYDISPERSE_FUNCTIONS), 5) 
     100        self.assertEqual(len(delegate.POLYDISPERSE_FUNCTIONS), 4) 
    101101        self.assertEqual(delegate.editableParameters(), [2, 3, 4, 5]) 
    102102        self.assertEqual(delegate.poly_function, 6) 
     
    595595        # Set data 
    596596        test_data = Data1D(x=[1,2], y=[1,2]) 
    597  
     597        item = QtGui.QStandardItem() 
     598        updateModelItem(item, [test_data], "test") 
    598599        # Force same data into logic 
    599         self.widget.logic.data = test_data 
    600         self.widget.data_is_loaded = True 
     600        self.widget.data = item 
    601601        category_index = self.widget.cbCategory.findText("Sphere") 
    602602        self.widget.cbCategory.setCurrentIndex(category_index) 
     
    625625 
    626626            # the fit button changed caption and got disabled 
    627             self.assertEqual(self.widget.cmdFit.text(), 'Calculating...') 
     627            self.assertEqual(self.widget.cmdFit.text(), 'Running...') 
    628628            self.assertFalse(self.widget.cmdFit.isEnabled()) 
    629629 
     
    644644 
    645645        # Force same data into logic 
    646         self.widget.logic.data = test_data 
    647         self.widget.data_is_loaded = True 
     646        item = QtGui.QStandardItem() 
     647        updateModelItem(item, [test_data], "test") 
     648        # Force same data into logic 
     649        self.widget.data = item 
    648650        category_index = self.widget.cbCategory.findText("Sphere") 
    649651        self.widget.cbCategory.setCurrentIndex(category_index) 
     
    672674 
    673675            # the fit button changed caption and got disabled 
    674             self.assertEqual(self.widget.cmdFit.text(), 'Calculating...') 
     676            self.assertEqual(self.widget.cmdFit.text(), 'Running...') 
    675677            self.assertFalse(self.widget.cmdFit.isEnabled()) 
    676678 
  • src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py

    r0d13814 r377ade1  
    8585    Custom delegate for appearance and behavior control of the polydispersity view 
    8686    """ 
    87     POLYDISPERSE_FUNCTIONS = ['rectangle', 'array', 'lognormal', 'gaussian', 'schulz'] 
     87    #POLYDISPERSE_FUNCTIONS = ['rectangle', 'array', 'lognormal', 'gaussian', 'schulz'] 
     88    POLYDISPERSE_FUNCTIONS = ['rectangle', 'lognormal', 'gaussian', 'schulz'] 
    8889 
    8990    combo_updated = QtCore.pyqtSignal(str, int) 
  • src/sas/qtgui/path_prepare.py

    r0d13814 r377ade1  
    4141else: 
    4242    root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) 
    43     addpath(os.path.join(root, 'src')) 
    44     addpath('src') 
     43    #addpath(os.path.join(root, 'src')) 
     44    #addpath('src') 
    4545    # Add the local build directory to PYTHONPATH 
    4646    from distutils.util import get_platform 
Note: See TracChangeset for help on using the changeset viewer.