Changeset b2a5042 in sasview for src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
- Timestamp:
- Aug 22, 2017 8:10:57 AM (7 years ago)
- 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:
- e43fc91
- Parents:
- 464cd07
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
r464cd07 rb2a5042 2 2 import unittest 3 3 import numpy 4 import platform 4 5 5 6 from PyQt4 import QtGui … … 48 49 self.data.title="Test data" 49 50 self.data.id = 1 51 self.isWindows = platform.system=="Windows" 50 52 51 53 def tearDown(self): … … 156 158 self.assertEqual(actions[2].text(), "Copy to Clipboard") 157 159 160 # Trigger Toggle Grid and make sure the method is called 161 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 162 self.plotter.ax.grid = MagicMock() 163 actions[4].trigger() 164 self.assertTrue(self.plotter.ax.grid.called) 165 166 # Trigger Change Scale and make sure the method is called 167 self.assertEqual(actions[6].text(), "Toggle Linear/Log Scale") 168 FigureCanvas.draw_idle = MagicMock() 169 actions[6].trigger() 170 self.assertTrue(FigureCanvas.draw_idle.called) 171 158 172 # Spy on cliboard's dataChanged() signal 173 if not self.isWindows: 174 return 159 175 self.clipboard_called = False 160 176 def done(): … … 164 180 QtGui.qApp.processEvents() 165 181 # Make sure clipboard got updated. 166 #self.assertTrue(self.clipboard_called) 167 168 # Trigger Toggle Grid and make sure the method is called 169 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 170 self.plotter.ax.grid = MagicMock() 171 actions[4].trigger() 172 self.assertTrue(self.plotter.ax.grid.called) 173 174 # Trigger Change Scale and make sure the method is called 175 self.assertEqual(actions[6].text(), "Toggle Linear/Log Scale") 176 FigureCanvas.draw_idle = MagicMock() 177 actions[6].trigger() 178 self.assertTrue(FigureCanvas.draw_idle.called) 182 self.assertTrue(self.clipboard_called) 179 183 180 184 def testShowNoPlot(self):
Note: See TracChangeset
for help on using the changeset viewer.