source: sasview/src/sas/qtgui/UnitTesting/InvariantTest.py @ f0858b6

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 f0858b6 was f721030, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago

Initial commit of the main window prototype

  • Property mode set to 100755
File size: 990 bytes
Line 
1import sys
2import unittest
3
4from PyQt4.QtGui import QApplication
5from PyQt4.QtTest import QTest
6from PyQt4.QtCore import Qt
7from new_invariant import InvariantWindow
8
9app = QApplication(sys.argv)
10
11class InvariantTest(unittest.TestCase):
12    '''Test the invariant GUI'''
13    def setUp(self):
14        '''Create the GUI'''
15        self.form = InvariantWindow()
16
17    def test_defaults(self):
18        '''Test the GUI in its default state'''
19        self.assertEqual(self.form.lineEdit_4.text(), "0.0")
20        self.assertEqual(self.form.lineEdit_6.text(), "1.0")
21        self.assertEqual(self.form.pushButton.text(), "Calculate")
22
23        # Class is in the default state even without pressing OK
24        self.assertEqual(self.form._background, 0.0)
25        self.assertEqual(self.form._scale, 1.0)
26       
27        # Push OK with the left mouse button
28        helpButton = self.form.pushButton_3
29        QTest.mouseClick(helpButton, Qt.LeftButton)
30
31if __name__ == "__main__":
32    unittest.main()
Note: See TracBrowser for help on using the repository browser.