Changes in src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py [5b144c6:b8080e1] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
r5b144c6 rb8080e1 57 57 self.plotter.data = self.data 58 58 self.plotter.show() 59 FigureCanvas.draw = MagicMock()59 FigureCanvas.draw_idle = MagicMock() 60 60 61 61 self.plotter.plot(hide_error=False) 62 62 63 63 self.assertEqual(self.plotter.ax.get_xscale(), 'log') 64 self.assertTrue(FigureCanvas.draw .called)64 self.assertTrue(FigureCanvas.draw_idle.called) 65 65 66 66 self.plotter.figure.clf() … … 70 70 self.plotter.data = self.data 71 71 self.plotter.show() 72 FigureCanvas.draw = MagicMock()72 FigureCanvas.draw_idle = MagicMock() 73 73 74 74 self.plotter.plot(hide_error=True) 75 75 76 76 self.assertEqual(self.plotter.ax.get_yscale(), 'log') 77 self.assertTrue(FigureCanvas.draw .called)77 self.assertTrue(FigureCanvas.draw_idle.called) 78 78 self.plotter.figure.clf() 79 79 … … 91 91 self.plotter.data = data 92 92 self.plotter.show() 93 FigureCanvas.draw = MagicMock()93 FigureCanvas.draw_idle = MagicMock() 94 94 95 95 self.plotter.plot(hide_error=True) … … 97 97 self.assertEqual(self.plotter.ax.get_xscale(), 'linear') 98 98 self.assertEqual(self.plotter.ax.get_yscale(), 'linear') 99 self.assertTrue(FigureCanvas.draw .called)99 self.assertTrue(FigureCanvas.draw_idle.called) 100 100 101 101 def testCreateContextMenuQuick(self): … … 262 262 # Just this one plot 263 263 self.assertEqual(len(list(self.plotter.plot_dict.keys())), 1) 264 self.plotter.onLinearFit( 'Test name')264 self.plotter.onLinearFit(1) 265 265 266 266 # Check that exec_ got called … … 289 289 290 290 # Delete one set 291 self.plotter.onRemovePlot( 'Test name 2')291 self.plotter.onRemovePlot(2) 292 292 # Assure we have two sets 293 293 self.assertEqual(len(list(self.plotter.plot_dict.keys())), 1) … … 296 296 297 297 # Delete the remaining set 298 self.plotter.onRemovePlot( 'Test name')298 self.plotter.onRemovePlot(1) 299 299 # Assure we have no plots 300 300 self.assertEqual(len(list(self.plotter.plot_dict.keys())), 0) … … 331 331 self.assertEqual(yl, "$YAXIS(cake)$") 332 332 # The hide_error flag should also remain 333 self.assertTrue(self.plotter.plot_dict[ 'Test name 2'].hide_error)333 self.assertTrue(self.plotter.plot_dict[2].hide_error) 334 334 self.plotter.figure.clf() 335 335 … … 355 355 356 356 # Reverse the toggle 357 self.plotter.onToggleHideError( 'Test name 2')357 self.plotter.onToggleHideError(2) 358 358 # See that the labels didn't change 359 359 xl = self.plotter.ax.xaxis.label.get_text() … … 362 362 self.assertEqual(yl, "$YAXIS(cake)$") 363 363 # The hide_error flag should toggle 364 self.assertEqual(self.plotter.plot_dict[ 'Test name 2'].hide_error, not error_status)364 self.assertEqual(self.plotter.plot_dict[2].hide_error, not error_status) 365 365 self.plotter.figure.clf() 366 366 … … 417 417 self.assertEqual(yl, "$YAXIS(cake)$") 418 418 # The hide_error flag should be as set 419 self.assertEqual(self.plotter.plot_dict[ 'Test name 2'].hide_error, error_status)419 self.assertEqual(self.plotter.plot_dict[2].hide_error, error_status) 420 420 self.plotter.figure.clf() 421 421
Note: See TracChangeset
for help on using the changeset viewer.