Changeset 464cd07 in sasview for src/sas/qtgui/MainWindow/UnitTesting
- Timestamp:
- Aug 22, 2017 3:59:29 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:
- b2a5042
- Parents:
- 457d961
- Location:
- src/sas/qtgui/MainWindow/UnitTesting
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/UnitTesting/AboutBoxTest.py
r83eb5208 r464cd07 3 3 import webbrowser 4 4 5 from PyQt4 .QtGui import *5 from PyQt4 import QtGui 6 6 from PyQt4.QtTest import QTest 7 from PyQt4 .QtCore import *7 from PyQt4 import QtCore 8 8 from mock import MagicMock 9 9 … … 15 15 import sas.qtgui.Utilities.LocalConfig as LocalConfig 16 16 17 app = QApplication(sys.argv) 17 if not QtGui.QApplication.instance(): 18 app = QtGui.QApplication(sys.argv) 18 19 19 20 class AboutBoxTest(unittest.TestCase): … … 30 31 def testDefaults(self): 31 32 '''Test the GUI in its default state''' 32 self.assertIsInstance(self.widget, Q Widget)33 self.assertIsInstance(self.widget, QtGui.QWidget) 33 34 self.assertEqual(self.widget.windowTitle(), "About") 34 35 self.assertEqual(self.widget.cmdOK.text(), "OK") … … 44 45 """ 45 46 version = self.widget.lblVersion 46 self.assertIsInstance(version, Q Label)47 self.assertIsInstance(version, QtGui.QLabel) 47 48 self.assertEqual(str(version.text()), str(LocalConfig.__version__)) 48 49 … … 52 53 """ 53 54 about = self.widget.lblAbout 54 self.assertIsInstance(about, Q Label)55 self.assertIsInstance(about, QtGui.QLabel) 55 56 # build version 56 57 self.assertIn(str(LocalConfig.__build__), about.text()) … … 82 83 83 84 # Press the buttons 84 buttonList = self.widget.findChildren(Q PushButton)85 buttonList = self.widget.findChildren(QtGui.QPushButton) 85 86 for button in buttonList: 86 QTest.mouseClick(button, Qt .LeftButton)87 QTest.mouseClick(button, QtCore.Qt.LeftButton) 87 88 #open_link = webbrowser.open.call_args 88 89 args, _ = webbrowser.open.call_args … … 96 97 self.assertTrue(self.widget.isVisible()) 97 98 # Click on the OK button 98 QTest.mouseClick(self.widget.cmdOK, Qt .LeftButton)99 QTest.mouseClick(self.widget.cmdOK, QtCore.Qt.LeftButton) 99 100 # assure the widget is no longer seen 100 101 self.assertFalse(self.widget.isVisible()) -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
rdc5ef15 r464cd07 25 25 import sas.qtgui.Plotting.PlotHelper as PlotHelper 26 26 27 app = QApplication(sys.argv) 27 if not QApplication.instance(): 28 app = QApplication(sys.argv) 28 29 29 30 class DataExplorerTest(unittest.TestCase): … … 441 442 # Click on the Help button 442 443 QTest.mouseClick(button1, Qt.LeftButton) 443 qApp.processEvents()444 QtGui.qApp.processEvents() 444 445 445 446 # Check the browser … … 450 451 # Click on the Help_2 button 451 452 QTest.mouseClick(button2, Qt.LeftButton) 452 qApp.processEvents()453 QtGui.qApp.processEvents() 453 454 # Check the browser 454 455 self.assertIn(partial_url, str(self.form._helpView.url())) -
src/sas/qtgui/MainWindow/UnitTesting/DroppableDataLoadWidgetTest.py
r83eb5208 r464cd07 13 13 from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 14 14 15 app = QApplication(sys.argv) 15 if not QApplication.instance(): 16 app = QApplication(sys.argv) 16 17 17 18 class DroppableDataLoadWidgetTest(unittest.TestCase): -
src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py
r83eb5208 r464cd07 24 24 from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 25 25 26 app = QApplication(sys.argv) 26 if not QApplication.instance(): 27 app = QApplication(sys.argv) 27 28 28 29 class GuiManagerTest(unittest.TestCase): -
src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py
r83eb5208 r464cd07 14 14 from sas.qtgui.MainWindow.MainWindow import SplashScreen 15 15 16 app = QtGui.QApplication(sys.argv) 16 if not QtGui.QApplication.instance(): 17 app = QtGui.QApplication(sys.argv) 17 18 18 19 class MainWindowTest(unittest.TestCase): -
src/sas/qtgui/MainWindow/UnitTesting/WelcomePanelTest.py
r83eb5208 r464cd07 10 10 from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel 11 11 12 app = QtGui.QApplication(sys.argv) 12 if not QtGui.QApplication.instance(): 13 app = QtGui.QApplication(sys.argv) 13 14 14 15 class WelcomePanelTest(unittest.TestCase):
Note: See TracChangeset
for help on using the changeset viewer.