Changeset 53c771e in sasview for src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py
- Timestamp:
- Nov 9, 2017 6:45:20 AM (6 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:
- dd150ef
- Parents:
- d6b8a1d
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/08/17 07:22:45)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 06:45:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py
r7fb471d r53c771e 3 3 from unittest.mock import MagicMock 4 4 5 from PyQt 4 import QtGui5 from PyQt5 import QtGui, QtWidgets 6 6 7 7 # set up import paths … … 11 11 from sas.qtgui.Plotting.PlotProperties import PlotProperties 12 12 13 if not Qt Gui.QApplication.instance():14 app = Qt Gui.QApplication(sys.argv)13 if not QtWidgets.QApplication.instance(): 14 app = QtWidgets.QApplication(sys.argv) 15 15 16 16 class PlotPropertiesTest(unittest.TestCase): … … 32 32 def testDefaults(self): 33 33 '''Test the GUI in its default state''' 34 self.assertIsInstance(self.widget, Qt Gui.QDialog)34 self.assertIsInstance(self.widget, QtWidgets.QDialog) 35 35 self.assertEqual(self.widget.windowTitle(), "Modify Plot Properties") 36 36 … … 56 56 '''Test the response to color change event''' 57 57 # Accept the new color 58 Qt Gui.QColorDialog.getColor = MagicMock(return_value=QtGui.QColor(255, 0, 255))58 QtWidgets.QColorDialog.getColor = MagicMock(return_value=QtGui.QColor(255, 0, 255)) 59 59 60 60 self.widget.onColorChange() … … 72 72 # Cancel the dialog now 73 73 bad_color = QtGui.QColor() # constructs an invalid color 74 Qt Gui.QColorDialog.getColor = MagicMock(return_value=bad_color)74 QtWidgets.QColorDialog.getColor = MagicMock(return_value=bad_color) 75 75 self.widget.onColorChange() 76 76
Note: See TracChangeset
for help on using the changeset viewer.