Changeset 6b43c58 in sasview for src/sas/qtgui


Ignore:
Timestamp:
Oct 25, 2017 10:11:25 AM (7 years ago)
Author:
Adam Washington <adam.washington@…>
Children:
20f7603
Parents:
e0ed8a8
Message:

Add unit test for Sesans Plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    rb2a5042 r6b43c58  
    7373 
    7474        self.assertEqual(self.plotter.ax.get_yscale(), 'log') 
     75        self.assertTrue(FigureCanvas.draw.called) 
     76 
     77    def testPlotWithSesans(self): 
     78        """ Ensure that Sesans data is plotted in linear cooredinates""" 
     79        data = Data1D(x=[1.0, 2.0, 3.0], 
     80                           y=[10.0, 11.0, 12.0], 
     81                           dx=[0.1, 0.2, 0.3], 
     82                           dy=[0.1, 0.2, 0.3]) 
     83        data.title="Sesans data" 
     84        data.name="Test Sesans" 
     85        data.isSesans = True 
     86        data.id = 2 
     87 
     88        self.plotter.data = data 
     89        self.plotter.show() 
     90        FigureCanvas.draw = MagicMock() 
     91 
     92        self.plotter.plot(hide_error=True) 
     93 
     94        self.assertEqual(self.plotter.ax.get_xscale(), 'linear') 
     95        self.assertEqual(self.plotter.ax.get_yscale(), 'linear') 
    7596        self.assertTrue(FigureCanvas.draw.called) 
    7697 
Note: See TracChangeset for help on using the changeset viewer.