Changeset 53c771e in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Nov 9, 2017 8:45:20 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:
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)
Message:

Converted unit tests

Location:
src/sas/qtgui/MainWindow
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    rd6b8a1d r53c771e  
    287287        delete_msg = "This operation will delete the checked data sets and all the dependents." +\ 
    288288                     "\nDo you want to continue?" 
    289         reply = QtGui.QMessageBox.question(self, 
     289        reply = QtWidgets.QMessageBox.question(self, 
    290290                                           'Warning', 
    291291                                           delete_msg, 
    292                                            QtGui.QMessageBox.Yes, 
    293                                            QtGui.QMessageBox.No) 
    294  
    295         if reply == QtGui.QMessageBox.No: 
     292                                           QtWidgets.QMessageBox.Yes, 
     293                                           QtWidgets.QMessageBox.No) 
     294 
     295        if reply == QtWidgets.QMessageBox.No: 
    296296            return 
    297297 
     
    327327        delete_msg = "This operation will delete the checked data sets and all the dependents." +\ 
    328328                     "\nDo you want to continue?" 
    329         reply = QtGui.QMessageBox.question(self, 
     329        reply = QtWidgets.QMessageBox.question(self, 
    330330                                           'Warning', 
    331331                                           delete_msg, 
    332                                            QtGui.QMessageBox.Yes, 
    333                                            QtGui.QMessageBox.No) 
    334  
    335         if reply == QtGui.QMessageBox.No: 
     332                                           QtWidgets.QMessageBox.Yes, 
     333                                           QtWidgets.QMessageBox.No) 
     334 
     335        if reply == QtWidgets.QMessageBox.No: 
    336336            return 
    337337 
     
    373373        if len(selected_items) > 1 and not self._perspective().allowBatch(): 
    374374            msg = self._perspective().title() + " does not allow multiple data." 
    375             msgbox = QtGui.QMessageBox() 
    376             msgbox.setIcon(QtGui.QMessageBox.Critical) 
     375            msgbox = QtWidgets.QMessageBox() 
     376            msgbox.setIcon(QtWidgets.QMessageBox.Critical) 
    377377            msgbox.setText(msg) 
    378             msgbox.setStandardButtons(QtGui.QMessageBox.Ok) 
     378            msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) 
    379379            retval = msgbox.exec_() 
    380380            return 
  • src/sas/qtgui/MainWindow/DroppableDataLoadWidget.py

    r4992ff2 r53c771e  
    5858            filenames=[] 
    5959            for url in event.mimeData().urls(): 
    60                 filenames.append(str(url.toLocalFile())) 
     60                filenames.append(url.toLocalFile()) 
    6161            self.communicator.fileReadSignal.emit(filenames) 
    6262            event.accept() 
  • src/sas/qtgui/MainWindow/MainWindow.py

    rd6b8a1d r53c771e  
    2727            self.guiManager = GuiManager(self) 
    2828        except Exception as ex: 
    29             print("EXCEPTION: ", ex) 
     29            import logging 
     30            logging.error("Application failed with: ", ex) 
     31            print("Application failed with: ", ex) 
    3032 
    3133    def closeEvent(self, event): 
  • src/sas/qtgui/MainWindow/UnitTesting/AboutBoxTest.py

    r7fb471d r53c771e  
    33import webbrowser 
    44 
    5 from PyQt4 import QtGui 
    6 from PyQt4.QtTest import QTest 
    7 from PyQt4 import QtCore 
     5from PyQt5 import QtGui, QtWidgets 
     6from PyQt5.QtTest import QTest 
     7from PyQt5 import QtCore 
    88from unittest.mock import MagicMock 
    99 
     
    1515import sas.qtgui.Utilities.LocalConfig as LocalConfig 
    1616 
    17 if not QtGui.QApplication.instance(): 
    18     app = QtGui.QApplication(sys.argv) 
     17if not QtWidgets.QApplication.instance(): 
     18    app = QtWidgets.QApplication(sys.argv) 
    1919 
    2020class AboutBoxTest(unittest.TestCase): 
     
    3131    def testDefaults(self): 
    3232        '''Test the GUI in its default state''' 
    33         self.assertIsInstance(self.widget, QtGui.QWidget) 
     33        self.assertIsInstance(self.widget, QtWidgets.QWidget) 
    3434        self.assertEqual(self.widget.windowTitle(), "About") 
    3535        self.assertEqual(self.widget.cmdOK.text(), "OK") 
     
    4545        """ 
    4646        version = self.widget.lblVersion 
    47         self.assertIsInstance(version, QtGui.QLabel) 
     47        self.assertIsInstance(version, QtWidgets.QLabel) 
    4848        self.assertEqual(str(version.text()), str(LocalConfig.__version__)) 
    4949 
     
    5353        """ 
    5454        about = self.widget.lblAbout 
    55         self.assertIsInstance(about, QtGui.QLabel) 
     55        self.assertIsInstance(about, QtWidgets.QLabel) 
    5656        # build version 
    5757        self.assertIn(str(LocalConfig.__build__), about.text()) 
     
    8383 
    8484        # Press the buttons 
    85         buttonList = self.widget.findChildren(QtGui.QPushButton) 
     85        buttonList = self.widget.findChildren(QtWidgets.QPushButton) 
    8686        for button in buttonList: 
    8787            QTest.mouseClick(button, QtCore.Qt.LeftButton) 
  • src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py

    r7fb471d r53c771e  
    22import unittest 
    33 
    4 from PyQt4.QtGui import * 
    5 from PyQt4.QtTest import QTest 
    6 from PyQt4.QtCore import * 
     4from PyQt5.QtGui import * 
     5from PyQt5.QtWidgets import * 
     6from PyQt5.QtTest import QTest 
     7from PyQt5.QtCore import * 
    78from unittest.mock import MagicMock 
    89from unittest.mock import patch 
     
    3637                return Communicate() 
    3738            def allowBatch(self): 
    38                 return False 
     39                return True 
    3940            def setData(self, data_item=None, is_batch=False): 
    4041                return None 
     
    114115 
    115116        # Return no files. 
    116         QtGui.QFileDialog.getOpenFileNames = MagicMock(return_value=None) 
     117        QFileDialog.getOpenFileNames = MagicMock(return_value=('','')) 
    117118 
    118119        # Click on the Load button 
     
    120121 
    121122        # Test the getOpenFileName() dialog called once 
    122         self.assertTrue(QtGui.QFileDialog.getOpenFileNames.called) 
    123         QtGui.QFileDialog.getOpenFileNames.assert_called_once() 
     123        self.assertTrue(QFileDialog.getOpenFileNames.called) 
     124        QFileDialog.getOpenFileNames.assert_called_once() 
    124125 
    125126        # Make sure the signal has not been emitted 
     
    127128 
    128129        # Now, return a single file 
    129         QtGui.QFileDialog.getOpenFileNames = MagicMock(return_value=filename) 
     130        QFileDialog.getOpenFileNames = MagicMock(return_value=(filename,'')) 
    130131 
    131132        # Click on the Load button 
    132133        QTest.mouseClick(loadButton, Qt.LeftButton) 
    133         QtGui.qApp.processEvents() 
     134        qApp.processEvents() 
    134135 
    135136        # Test the getOpenFileName() dialog called once 
    136         self.assertTrue(QtGui.QFileDialog.getOpenFileNames.called) 
    137         QtGui.QFileDialog.getOpenFileNames.assert_called_once() 
     137        self.assertTrue(QFileDialog.getOpenFileNames.called) 
     138        QFileDialog.getOpenFileNames.assert_called_once() 
    138139 
    139140        # Expected one spy instance 
     
    167168 
    168169        # Mock the confirmation dialog with return=No 
    169         QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.No) 
     170        QMessageBox.question = MagicMock(return_value=QMessageBox.No) 
    170171 
    171172        # Populate the model 
     
    180181        item2 = self.form.model.item(1) 
    181182        item3 = self.form.model.item(2) 
    182         self.assertTrue(item1.checkState() == QtCore.Qt.Checked) 
    183         self.assertTrue(item2.checkState() == QtCore.Qt.Checked) 
    184         self.assertTrue(item3.checkState() == QtCore.Qt.Checked) 
     183        self.assertTrue(item1.checkState() == Qt.Checked) 
     184        self.assertTrue(item2.checkState() == Qt.Checked) 
     185        self.assertTrue(item3.checkState() == Qt.Checked) 
    185186 
    186187        # Click on the delete  button 
     
    188189 
    189190        # Test the warning dialog called once 
    190         self.assertTrue(QtGui.QMessageBox.question.called) 
     191        self.assertTrue(QMessageBox.question.called) 
    191192 
    192193        # Assure the model still contains the items 
     
    194195 
    195196        # Now, mock the confirmation dialog with return=Yes 
    196         QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.Yes) 
     197        QMessageBox.question = MagicMock(return_value=QMessageBox.Yes) 
    197198 
    198199        # Click on the delete  button 
     
    200201 
    201202        # Test the warning dialog called once 
    202         self.assertTrue(QtGui.QMessageBox.question.called) 
     203        self.assertTrue(QMessageBox.question.called) 
    203204 
    204205        # Assure the model contains no items 
     
    215216 
    216217        # Mock the confirmation dialog with return=No 
    217         QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.No) 
     218        QMessageBox.question = MagicMock(return_value=QMessageBox.No) 
    218219 
    219220        # Populate the model 
    220         item1 = QtGui.QStandardItem(True) 
     221        item1 = QStandardItem(True) 
    221222        item1.setCheckable(True) 
    222         item1.setCheckState(QtCore.Qt.Checked) 
     223        item1.setCheckState(Qt.Checked) 
    223224        item1.setText("item 1") 
    224225        self.form.theory_model.appendRow(item1) 
    225         item2 = QtGui.QStandardItem(True) 
     226        item2 = QStandardItem(True) 
    226227        item2.setCheckable(True) 
    227         item2.setCheckState(QtCore.Qt.Unchecked) 
     228        item2.setCheckState(Qt.Unchecked) 
    228229        item2.setText("item 2") 
    229230        self.form.theory_model.appendRow(item2) 
     
    233234 
    234235        # Assure the checkboxes are on 
    235         self.assertTrue(item1.checkState() == QtCore.Qt.Checked) 
    236         self.assertTrue(item2.checkState() == QtCore.Qt.Unchecked) 
     236        self.assertTrue(item1.checkState() == Qt.Checked) 
     237        self.assertTrue(item2.checkState() == Qt.Unchecked) 
    237238 
    238239        # Click on the delete  button 
     
    240241 
    241242        # Test the warning dialog called once 
    242         self.assertTrue(QtGui.QMessageBox.question.called) 
     243        self.assertTrue(QMessageBox.question.called) 
    243244 
    244245        # Assure the model still contains the items 
     
    246247 
    247248        # Now, mock the confirmation dialog with return=Yes 
    248         QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.Yes) 
     249        QMessageBox.question = MagicMock(return_value=QMessageBox.Yes) 
    249250 
    250251        # Click on the delete  button 
     
    252253 
    253254        # Test the warning dialog called once 
    254         self.assertTrue(QtGui.QMessageBox.question.called) 
     255        self.assertTrue(QMessageBox.question.called) 
    255256 
    256257        # Assure the model contains 1 item 
     
    258259 
    259260        # Set the remaining item to checked 
    260         self.form.theory_model.item(0).setCheckState(QtCore.Qt.Checked) 
     261        self.form.theory_model.item(0).setCheckState(Qt.Checked) 
    261262 
    262263        # Click on the delete button again 
     
    306307 
    307308        # Mock the warning message 
    308         QtGui.QMessageBox = MagicMock() 
     309        QMessageBox = MagicMock() 
    309310 
    310311        # Click on the button 
     
    312313 
    313314        # Assure the message box popped up 
    314         QtGui.QMessageBox.assert_called_once() 
     315        QMessageBox.assert_called_once() 
    315316 
    316317    def testDataSelection(self): 
     
    325326        self.form.cbSelect.setCurrentIndex(1) 
    326327 
    327         self.form.show() 
    328         app.exec_() 
    329  
    330328        # Test the current selection 
    331329        item1D = self.form.model.item(0) 
    332330        item2D = self.form.model.item(1) 
    333         self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked) 
    334         self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)         
     331        self.assertTrue(item1D.checkState() == Qt.Unchecked) 
     332        self.assertTrue(item2D.checkState() == Qt.Unchecked)         
    335333 
    336334        # Select all data 
     
    338336 
    339337        # Test the current selection 
    340         self.assertTrue(item1D.checkState() == QtCore.Qt.Checked) 
    341         self.assertTrue(item2D.checkState() == QtCore.Qt.Checked)         
     338        self.assertTrue(item1D.checkState() == Qt.Checked) 
     339        self.assertTrue(item2D.checkState() == Qt.Checked)         
    342340 
    343341        # select 1d data 
     
    345343 
    346344        # Test the current selection 
    347         self.assertTrue(item1D.checkState() == QtCore.Qt.Checked) 
    348         self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)         
     345        self.assertTrue(item1D.checkState() == Qt.Checked) 
     346        self.assertTrue(item2D.checkState() == Qt.Unchecked)         
    349347 
    350348        # unselect 1d data 
     
    352350 
    353351        # Test the current selection 
    354         self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked) 
    355         self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)         
     352        self.assertTrue(item1D.checkState() == Qt.Unchecked) 
     353        self.assertTrue(item2D.checkState() == Qt.Unchecked)         
    356354 
    357355        # select 2d data 
     
    359357 
    360358        # Test the current selection 
    361         self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked) 
    362         self.assertTrue(item2D.checkState() == QtCore.Qt.Checked)         
     359        self.assertTrue(item1D.checkState() == Qt.Unchecked) 
     360        self.assertTrue(item2D.checkState() == Qt.Checked)         
    363361 
    364362        # unselect 2d data 
     
    366364 
    367365        # Test the current selection 
    368         self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked) 
    369         self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)         
     366        self.assertTrue(item1D.checkState() == Qt.Unchecked) 
     367        self.assertTrue(item2D.checkState() == Qt.Unchecked)         
    370368 
    371369        # choose impossible index and assure the code raises 
     
    385383        """ 
    386384        # Create an item with several branches 
    387         item1 = QtGui.QStandardItem() 
    388         item2 = QtGui.QStandardItem() 
    389         item3 = QtGui.QStandardItem() 
    390         item4 = QtGui.QStandardItem() 
    391         item5 = QtGui.QStandardItem() 
    392         item6 = QtGui.QStandardItem() 
     385        item1 = QStandardItem() 
     386        item2 = QStandardItem() 
     387        item3 = QStandardItem() 
     388        item4 = QStandardItem() 
     389        item5 = QStandardItem() 
     390        item6 = QStandardItem() 
    393391 
    394392        item4.appendRow(item5) 
     
    432430        # The 0th item header should be the name of the file 
    433431        model_item = self.form.model.index(0,0) 
    434         model_name = str(self.form.model.data(model_item).toString()) 
     432        model_name = self.form.model.data(model_item) 
    435433        self.assertEqual(model_name, filename[0]) 
    436434 
     
    445443        # Click on the Help button 
    446444        QTest.mouseClick(button1, Qt.LeftButton) 
    447         QtGui.qApp.processEvents() 
     445        qApp.processEvents() 
    448446 
    449447        # Check the browser 
     
    454452        # Click on the Help_2 button 
    455453        QTest.mouseClick(button2, Qt.LeftButton) 
    456         QtGui.qApp.processEvents() 
     454        qApp.processEvents() 
    457455        # Check the browser 
    458456        self.assertIn(partial_url, str(self.form._helpView.url())) 
     
    596594        p_file="cyl_400_20.txt" 
    597595        output_object = loader.load(p_file) 
    598         output_item = QtGui.QStandardItem() 
     596        output_item = QStandardItem() 
    599597        new_data = [(output_item, manager.create_gui_data(output_object[0], p_file))] 
    600598 
     
    644642        Assure the model update is correct 
    645643        """ 
    646         good_item = QtGui.QStandardItem() 
     644        good_item = QStandardItem() 
    647645        bad_item = "I'm so bad" 
    648646 
     
    669667 
    670668        # Pick up the treeview index corresponding to that file 
    671         index = self.form.treeView.indexAt(QtCore.QPoint(5,5)) 
     669        index = self.form.treeView.indexAt(QPoint(5,5)) 
    672670        self.form.show() 
    673671 
  • src/sas/qtgui/MainWindow/UnitTesting/DroppableDataLoadWidgetTest.py

    r464cd07 r53c771e  
    22import unittest 
    33 
    4 from PyQt4.QtGui import QApplication 
    5 from PyQt4.QtTest import QTest 
    6 from PyQt4 import QtCore 
     4from PyQt5.QtWidgets import QApplication 
     5from PyQt5.QtTest import QTest 
     6from PyQt5 import QtCore 
    77 
    88# set up import paths 
     
    6262 
    6363        drop_event = QtGui.QDropEvent(QtCore.QPoint(0,0), 
    64                                            QtCore.Qt.CopyAction, 
    65                                            self.mime_data, 
    66                                            QtCore.Qt.LeftButton, 
    67                                            QtCore.Qt.NoModifier) 
     64                                    QtCore.Qt.CopyAction, 
     65                                    self.mime_data, 
     66                                    QtCore.Qt.LeftButton, 
     67                                    QtCore.Qt.NoModifier) 
    6868 
    6969        self.form.dropEvent(drop_event) 
    70         QtGui.qApp.processEvents() 
     70        QApplication.processEvents() 
    7171        self.assertEqual(spy_file_read.count(), 1) 
    7272        self.assertIn(self.testfile, str(spy_file_read.signal(index=0))) 
  • src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py

    r7fb471d r53c771e  
    55import logging 
    66 
    7 from PyQt4.QtGui import * 
    8 from PyQt4.QtTest import QTest 
    9 from PyQt4.QtCore import * 
    10 from PyQt4.QtWebKit import * 
     7from PyQt5.QtGui import * 
     8from PyQt5.QtWidgets import * 
     9from PyQt5.QtTest import QTest 
     10from PyQt5.QtCore import * 
     11from PyQt5.QtWebKit import * 
    1112from unittest.mock import MagicMock 
    1213 
     
    1819from sas.qtgui.MainWindow.AboutBox import AboutBox 
    1920from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel 
    20 from sas.qtgui.Utilities.IPythonWidget import IPythonWidget 
     21#from sas.qtgui.Utilities.IPythonWidget import IPythonWidget 
    2122 
    2223from sas.qtgui.MainWindow.GuiManager import Acknowledgements, GuiManager 
     
    3738         
    3839                # define workspace for dialogs. 
    39                 self.workspace = QWorkspace(self) 
     40                self.workspace = QMdiArea(self) 
    4041                self.setCentralWidget(self.workspace) 
    4142 
     
    221222        """ 
    222223        # Mock the system file open method 
    223         QFileDialog.getOpenFileNames = MagicMock(return_value=None) 
     224        QFileDialog.getOpenFileNames = MagicMock(return_value=('','')) 
    224225 
    225226        # invoke the action 
     
    234235        """ 
    235236        # Mock the system file open method 
    236         QFileDialog.getExistingDirectory = MagicMock(return_value=None) 
     237        QFileDialog.getExistingDirectory = MagicMock(return_value=('','')) 
    237238 
    238239        # invoke the action 
     
    270271 
    271272    #### HELP #### 
    272     def testActionDocumentation(self): 
     273    # test when PyQt5 works with html 
     274    def notestActionDocumentation(self): 
    273275        """ 
    274276        Menu Help/Documentation 
  • src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py

    r7fb471d r53c771e  
    11import sys 
    22import unittest 
     3import logging 
    34 
    4 from PyQt4 import QtGui 
    5 from PyQt4 import QtTest 
    6 from PyQt4 import QtCore 
     5from PyQt5 import QtGui, QtWidgets 
     6from PyQt5 import QtTest 
     7from PyQt5 import QtCore 
    78from unittest.mock import MagicMock 
    89 
     
    1314from sas.qtgui.MainWindow.MainWindow import MainSasViewWindow 
    1415from sas.qtgui.MainWindow.MainWindow import SplashScreen 
     16from sas.qtgui.MainWindow.GuiManager import GuiManager 
    1517 
    16 if not QtGui.QApplication.instance(): 
    17     app = QtGui.QApplication(sys.argv) 
     18if not QtWidgets.QApplication.instance(): 
     19    app = QtWidgets.QApplication(sys.argv) 
    1820 
    1921class MainWindowTest(unittest.TestCase): 
     
    3032    def testDefaults(self): 
    3133        """Test the GUI in its default state""" 
    32         self.assertIsInstance(self.widget, QtGui.QMainWindow) 
    33         self.assertIsInstance(self.widget.centralWidget(), QtGui.QWorkspace) 
     34        self.assertIsInstance(self.widget, QtWidgets.QMainWindow) 
     35        self.assertIsInstance(self.widget.centralWidget(), QtWidgets.QMdiArea) 
    3436         
    3537    def testSplashScreen(self): 
    3638        """ Test the splash screen """ 
    3739        splash = SplashScreen() 
    38         self.assertIsInstance(splash, QtGui.QSplashScreen) 
     40        self.assertIsInstance(splash, QtWidgets.QSplashScreen) 
    3941 
    4042    def testExit(self): 
     
    4446        # Must mask sys.exit, otherwise the whole testing process stops. 
    4547        sys.exit = MagicMock() 
    46         QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.Yes) 
     48        QtWidgets.QMessageBox.question = MagicMock(return_value=QtWidgets.QMessageBox.Yes) 
    4749 
    4850        # Open, then close the main window 
     
    5153 
    5254        # See that the MessageBox method got called 
    53         self.assertTrue(QtGui.QMessageBox.question.called) 
     55        self.assertTrue(QtWidgets.QMessageBox.question.called) 
    5456        
    5557if __name__ == "__main__": 
  • src/sas/qtgui/MainWindow/UnitTesting/WelcomePanelTest.py

    r464cd07 r53c771e  
    22import unittest 
    33 
    4 from PyQt4 import QtGui 
     4from PyQt5 import QtGui, QtWidgets 
    55 
    66# set up import paths 
     
    1010from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel 
    1111 
    12 if not QtGui.QApplication.instance(): 
    13     app = QtGui.QApplication(sys.argv) 
     12if not QtWidgets.QApplication.instance(): 
     13    app = QtWidgets.QApplication(sys.argv) 
    1414 
    1515class WelcomePanelTest(unittest.TestCase): 
     
    2727    def testDefaults(self): 
    2828        '''Test the GUI in its default state''' 
    29         self.assertIsInstance(self.widget, QtGui.QDialog) 
     29        self.assertIsInstance(self.widget, QtWidgets.QDialog) 
    3030        self.assertEqual(self.widget.windowTitle(), "Welcome") 
    3131         
     
    3333        '''Test the version string''' 
    3434        version = self.widget.lblVersion 
    35         self.assertIsInstance(version, QtGui.QLabel) 
     35        self.assertIsInstance(version, QtWidgets.QLabel) 
    3636 
    3737        self.assertIn("SasView", version.text()) 
Note: See TracChangeset for help on using the changeset viewer.