ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change
on this file since 2a174d4 was
53c771e,
checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago
|
Converted unit tests
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[488c49d] | 1 | import sys |
---|
| 2 | import unittest |
---|
| 3 | |
---|
[53c771e] | 4 | from PyQt5 import QtGui, QtWidgets |
---|
[488c49d] | 5 | |
---|
[31c5b58] | 6 | # set up import paths |
---|
| 7 | import path_prepare |
---|
| 8 | |
---|
[488c49d] | 9 | # Local |
---|
[83eb5208] | 10 | from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel |
---|
[488c49d] | 11 | |
---|
[53c771e] | 12 | if not QtWidgets.QApplication.instance(): |
---|
| 13 | app = QtWidgets.QApplication(sys.argv) |
---|
[488c49d] | 14 | |
---|
| 15 | class 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''' |
---|
[53c771e] | 29 | self.assertIsInstance(self.widget, QtWidgets.QDialog) |
---|
[488c49d] | 30 | self.assertEqual(self.widget.windowTitle(), "Welcome") |
---|
| 31 | |
---|
| 32 | def testVersion(self): |
---|
[adf81b8] | 33 | '''Test the version string''' |
---|
[488c49d] | 34 | version = self.widget.lblVersion |
---|
[53c771e] | 35 | self.assertIsInstance(version, QtWidgets.QLabel) |
---|
[adf81b8] | 36 | |
---|
| 37 | self.assertIn("SasView", version.text()) |
---|
| 38 | self.assertIn("Build:", version.text()) |
---|
| 39 | self.assertIn("UTK, UMD, NIST, ORNL, ISIS, ESS, ILL and ANSTO", version.text()) |
---|
[488c49d] | 40 | |
---|
| 41 | if __name__ == "__main__": |
---|
| 42 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.