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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/UnitTesting/ResolutionCalculatorPanelTest.py

    r7fb471d r53c771e  
    44import logging 
    55import unittest 
    6 from PyQt4 import QtGui 
    7 from PyQt4 import QtCore 
    8 from PyQt4.QtTest import QTest 
    9 from PyQt4.QtCore import Qt 
     6from PyQt5 import QtGui, QtWidgets 
     7from PyQt5 import QtCore 
     8from PyQt5.QtTest import QTest 
     9from PyQt5.QtCore import Qt 
    1010from unittest.mock import MagicMock 
    1111 
     
    2727 
    2828 
    29 if not QtGui.QApplication.instance(): 
    30     app = QtGui.QApplication(sys.argv) 
     29if not QtWidgets.QApplication.instance(): 
     30    app = QtWidgets.QApplication(sys.argv) 
    3131 
    3232 
     
    4747        """Test the GUI in its default state""" 
    4848 
    49         self.assertIsInstance(self.widget, QtGui.QDialog) 
     49        self.assertIsInstance(self.widget, QtWidgets.QDialog) 
    5050        self.assertEqual(self.widget.windowTitle(), "Q Resolution Estimator") 
    5151        # size 
     
    230230    def testOnSelectCustomSpectrum(self): 
    231231        """ Test Custom Spectrum: load file if 'Add New' """ 
    232         QtGui.QFileDialog.getOpenFileName = MagicMock(return_value=None) 
     232        QtWidgets.QFileDialog.getOpenFileName = MagicMock(return_value=("","")) 
    233233        self.widget.cbCustomSpectrum.setCurrentIndex(1) 
    234234 
    235235        # Test the getOpenFileName() dialog called once 
    236         self.assertTrue(QtGui.QFileDialog.getOpenFileName.called) 
    237         QtGui.QFileDialog.getOpenFileName.assert_called_once() 
     236        self.assertTrue(QtWidgets.QFileDialog.getOpenFileName.called) 
     237        QtWidgets.QFileDialog.getOpenFileName.assert_called_once() 
    238238 
    239239    def testHelp(self): 
Note: See TracChangeset for help on using the changeset viewer.