Changeset 53c771e in sasview for src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py
- Timestamp:
- Nov 9, 2017 8:45:20 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:
- dd150ef
- Parents:
- d6b8a1d
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/08/17 09:22:45)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:45:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/UnitTesting/AddTextTest.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.AddText import AddText 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 AddTextTest(unittest.TestCase): … … 27 27 def testDefaults(self): 28 28 '''Test the GUI in its default state''' 29 self.assertIsInstance(self.widget, Qt Gui.QDialog)29 self.assertIsInstance(self.widget, QtWidgets.QDialog) 30 30 self.assertIsInstance(self.widget._font, QtGui.QFont) 31 31 self.assertEqual(self.widget._color, "black") … … 34 34 '''Test the QFontDialog output''' 35 35 font_1 = QtGui.QFont("Helvetica", 15) 36 Qt Gui.QFontDialog.getFont = MagicMock(return_value=(font_1, True))36 QtWidgets.QFontDialog.getFont = MagicMock(return_value=(font_1, True)) 37 37 # Call the method 38 38 self.widget.onFontChange(None) … … 42 42 # See that rejecting the dialog doesn't modify the font 43 43 font_2 = QtGui.QFont("Arial", 9) 44 Qt Gui.QFontDialog.getFont = MagicMock(return_value=(font_2, False))44 QtWidgets.QFontDialog.getFont = MagicMock(return_value=(font_2, False)) 45 45 # Call the method 46 46 self.widget.onFontChange(None) … … 51 51 ''' Test the QColorDialog output''' 52 52 new_color = QtGui.QColor("red") 53 Qt Gui.QColorDialog.getColor = MagicMock(return_value=new_color)53 QtWidgets.QColorDialog.getColor = MagicMock(return_value=new_color) 54 54 # Call the method 55 55 self.widget.onColorChange(None)
Note: See TracChangeset
for help on using the changeset viewer.