Ignore:
Timestamp:
Nov 8, 2017 9:22:45 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
0e80658
Parents:
412e069e
Message:

Converted unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py

    r99ea1b0 r3e8dee3  
    33from unittest.mock import MagicMock 
    44 
    5 from PyQt4 import QtGui 
     5from PyQt5 import QtGui, QtWidgets 
    66 
    77# set up import paths 
     
    1111from sas.qtgui.Plotting.PlotProperties import PlotProperties 
    1212 
    13 if not QtGui.QApplication.instance(): 
    14     app = QtGui.QApplication(sys.argv) 
     13if not QtWidgets.QApplication.instance(): 
     14    app = QtWidgets.QApplication(sys.argv) 
    1515 
    1616class PlotPropertiesTest(unittest.TestCase): 
     
    3232    def testDefaults(self): 
    3333        '''Test the GUI in its default state''' 
    34         self.assertIsInstance(self.widget, QtGui.QDialog) 
     34        self.assertIsInstance(self.widget, QtWidgets.QDialog) 
    3535        self.assertEqual(self.widget.windowTitle(), "Modify Plot Properties") 
    3636 
     
    5656        '''Test the response to color change event''' 
    5757        # Accept the new color 
    58         QtGui.QColorDialog.getColor = MagicMock(return_value=QtGui.QColor(255, 0, 255)) 
     58        QtWidgets.QColorDialog.getColor = MagicMock(return_value=QtGui.QColor(255, 0, 255)) 
    5959 
    6060        self.widget.onColorChange() 
     
    7272        # Cancel the dialog now 
    7373        bad_color = QtGui.QColor() # constructs an invalid color 
    74         QtGui.QColorDialog.getColor = MagicMock(return_value=bad_color) 
     74        QtWidgets.QColorDialog.getColor = MagicMock(return_value=bad_color) 
    7575        self.widget.onColorChange() 
    7676 
Note: See TracChangeset for help on using the changeset viewer.