Changeset 53c771e in sasview for src/sas/qtgui/Calculators/UnitTesting/ResolutionCalculatorPanelTest.py
- Timestamp:
- Nov 9, 2017 8: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 09:22:45)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:45:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/UnitTesting/ResolutionCalculatorPanelTest.py
r7fb471d r53c771e 4 4 import logging 5 5 import unittest 6 from PyQt 4 import QtGui7 from PyQt 4import QtCore8 from PyQt 4.QtTest import QTest9 from PyQt 4.QtCore import Qt6 from PyQt5 import QtGui, QtWidgets 7 from PyQt5 import QtCore 8 from PyQt5.QtTest import QTest 9 from PyQt5.QtCore import Qt 10 10 from unittest.mock import MagicMock 11 11 … … 27 27 28 28 29 if not Qt Gui.QApplication.instance():30 app = Qt Gui.QApplication(sys.argv)29 if not QtWidgets.QApplication.instance(): 30 app = QtWidgets.QApplication(sys.argv) 31 31 32 32 … … 47 47 """Test the GUI in its default state""" 48 48 49 self.assertIsInstance(self.widget, Qt Gui.QDialog)49 self.assertIsInstance(self.widget, QtWidgets.QDialog) 50 50 self.assertEqual(self.widget.windowTitle(), "Q Resolution Estimator") 51 51 # size … … 230 230 def testOnSelectCustomSpectrum(self): 231 231 """ Test Custom Spectrum: load file if 'Add New' """ 232 Qt Gui.QFileDialog.getOpenFileName = MagicMock(return_value=None)232 QtWidgets.QFileDialog.getOpenFileName = MagicMock(return_value=("","")) 233 233 self.widget.cbCustomSpectrum.setCurrentIndex(1) 234 234 235 235 # Test the getOpenFileName() dialog called once 236 self.assertTrue(Qt Gui.QFileDialog.getOpenFileName.called)237 Qt Gui.QFileDialog.getOpenFileName.assert_called_once()236 self.assertTrue(QtWidgets.QFileDialog.getOpenFileName.called) 237 QtWidgets.QFileDialog.getOpenFileName.assert_called_once() 238 238 239 239 def testHelp(self):
Note: See TracChangeset
for help on using the changeset viewer.