source: sasview/src/sas/qtgui/UnitTesting/WelcomePanelTest.py @ 31c5b58

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 31c5b58 was 31c5b58, checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago

Refactored to allow running with run.py.
Minor fixes to plotting.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import sys
2import unittest
3
4from PyQt4.QtGui import *
5from PyQt4.QtTest import QTest
6from PyQt4.QtCore import *
7
8# set up import paths
9import path_prepare
10
11# Local
12from WelcomePanel import WelcomePanel
13
14app = QApplication(sys.argv)
15
16class WelcomePanelTest(unittest.TestCase):
17    '''Test the WelcomePanel'''
18    def setUp(self):
19        '''Create the WelcomePanel'''
20
21        self.widget = WelcomePanel(None)
22
23    def tearDown(self):
24        '''Destroy the GUI'''
25        self.widget.close()
26        self.widget = None
27
28    def testDefaults(self):
29        '''Test the GUI in its default state'''
30        self.assertIsInstance(self.widget, QDialog)
31        self.assertEqual(self.widget.windowTitle(), "Welcome")
32       
33    def testVersion(self):
34        """
35        """
36        version = self.widget.lblVersion
37        self.assertIsInstance(version, QLabel)
38        ver_text = "\nSasView 4.0.0-alpha\nBuild: 1\n(c) 2009 - 2013, UTK, UMD, NIST, ORNL, ISIS, ESS and IL"
39        #self.assertEqual(str(version.text()), ver_text)
40        self.assertIn("SasView", str(version.text()))
41        self.assertIn("Build:", str(version.text()))
42       
43if __name__ == "__main__":
44    unittest.main()
Note: See TracBrowser for help on using the repository browser.