source: sasview/src/sas/qtgui/MainWindow/UnitTesting/WelcomePanelTest.py @ 7385fec

ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 7385fec was 7385fec, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 6 years ago

Updated About and Acknowledgement windows. SASVIEW-1184

  • Property mode set to 100644
File size: 1.1 KB
Line 
1import sys
2import unittest
3
4from PyQt5 import QtGui, QtWidgets
5
6# set up import paths
7import path_prepare
8
9# Local
10from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel
11
12if not QtWidgets.QApplication.instance():
13    app = QtWidgets.QApplication(sys.argv)
14
15class WelcomePanelTest(unittest.TestCase):
16    '''Test the WelcomePanel'''
17    def setUp(self):
18        '''Create the WelcomePanel'''
19
20        self.widget = WelcomePanel(None)
21
22    def tearDown(self):
23        '''Destroy the GUI'''
24        self.widget.close()
25        self.widget = None
26
27    def testDefaults(self):
28        '''Test the GUI in its default state'''
29        self.assertIsInstance(self.widget, QtWidgets.QDialog)
30        self.assertEqual(self.widget.windowTitle(), "Welcome")
31       
32    def testVersion(self):
33        '''Test the version string'''
34        version = self.widget.lblVersion
35        self.assertIsInstance(version, QtWidgets.QLabel)
36
37        self.assertIn("SasView", version.text())
38        self.assertIn("Build:", version.text())
39        self.assertIn("UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO and BAM", version.text())
40       
41if __name__ == "__main__":
42    unittest.main()
Note: See TracBrowser for help on using the repository browser.