Changeset b2a5042 in sasview for src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
- Timestamp:
- Aug 22, 2017 6: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/PlotterTest.py
r464cd07 rb2a5042 1 1 import sys 2 2 import unittest 3 import platform 3 4 4 5 from PyQt4 import QtGui … … 37 38 self.data.name="Test name" 38 39 self.data.id = 1 40 self.isWindows = platform.system=="Windows" 39 41 40 42 def tearDown(self): … … 94 96 self.assertEqual(actions[2].text(), "Copy to Clipboard") 95 97 98 # Trigger Toggle Grid and make sure the method is called 99 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 100 self.plotter.ax.grid = MagicMock() 101 actions[4].trigger() 102 self.assertTrue(self.plotter.ax.grid.called) 103 104 # Trigger Change Scale and make sure the method is called 105 self.assertEqual(actions[6].text(), "Change Scale") 106 self.plotter.properties.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected) 107 actions[6].trigger() 108 self.assertTrue(self.plotter.properties.exec_.called) 109 96 110 # Spy on cliboard's dataChanged() signal 111 if not self.isWindows: 112 return 97 113 self.clipboard_called = False 98 114 def done(): … … 102 118 QtGui.qApp.processEvents() 103 119 # Make sure clipboard got updated. 104 #self.assertTrue(self.clipboard_called) 105 106 # Trigger Toggle Grid and make sure the method is called 107 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 108 self.plotter.ax.grid = MagicMock() 109 actions[4].trigger() 110 self.assertTrue(self.plotter.ax.grid.called) 111 112 # Trigger Change Scale and make sure the method is called 113 self.assertEqual(actions[6].text(), "Change Scale") 114 self.plotter.properties.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected) 115 actions[6].trigger() 116 self.assertTrue(self.plotter.properties.exec_.called) 120 self.assertTrue(self.clipboard_called) 117 121 118 122 def testXyTransform(self):
Note: See TracChangeset
for help on using the changeset viewer.