Changeset cad617b in sasview for src/sas/qtgui/UnitTesting


Ignore:
Timestamp:
Dec 8, 2016 3:46:27 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:
b4b8589, d1fb22ee
Parents:
416fa8f
Message:

Code review issues, fixing matplotlib behaviour in unit testing, minor fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/UnitTesting/DataExplorerTest.py

    r6d05e1d rcad617b  
    77from mock import MagicMock 
    88from mock import patch 
     9from mpl_toolkits.mplot3d import Axes3D 
    910 
    1011# set up import paths 
     
    2122from UnitTesting.TestUtils import QtSignalSpy 
    2223from sas.qtgui.Plotter import Plotter 
     24from sas.qtgui.Plotter2D import Plotter2D 
    2325import sas.qtgui.PlotHelper as PlotHelper 
    2426 
     
    758760        """ 
    759761        Quick data plot generation. 
     762        """ 
     763        # get Data1D 
     764        p_file=["cyl_400_20.txt"] 
     765        # Read in the file 
     766        output, message = self.form.readData(p_file) 
     767        self.form.loadComplete((output, message)) 
     768 
     769        # select the data 
     770        self.form.treeView.selectAll() 
     771 
     772        Plotter.show = MagicMock() # for masking the display 
     773 
     774        self.form.quickDataPlot() 
     775        self.assertTrue(Plotter.show.called) 
     776 
     777    def testQuickData3DPlot(self): 
     778        """ 
     779        Slow(er) 3D data plot generation. 
     780        """ 
     781        # get Data1D 
     782        p_file=["Dec07031.ASC"] 
     783        # Read in the file 
     784        output, message = self.form.readData(p_file) 
     785        self.form.loadComplete((output, message)) 
     786 
     787        # select the data 
     788        self.form.treeView.selectAll() 
     789 
     790        Plotter2D.show = MagicMock() # for masking the display 
     791 
     792        self.form.quickData3DPlot() 
     793 
     794        self.assertTrue(Plotter2D.show.called) 
     795 
     796    def testShowEditMask(self): 
     797        """ 
     798        Edit mask on a 2D plot. 
    760799 
    761800        TODO: add content once plotting finalized 
    762801        """ 
    763802        pass 
     803 
    764804 
    765805if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.