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 f140169 was
f721030,
checked in by Piotr Rozyczko <piotr.rozyczko@…>, 8 years ago
|
Initial commit of the main window prototype
|
-
Property mode set to
100755
|
File size:
990 bytes
|
Rev | Line | |
---|
[f721030] | 1 | import sys |
---|
| 2 | import unittest |
---|
| 3 | |
---|
| 4 | from PyQt4.QtGui import QApplication |
---|
| 5 | from PyQt4.QtTest import QTest |
---|
| 6 | from PyQt4.QtCore import Qt |
---|
| 7 | from new_invariant import InvariantWindow |
---|
| 8 | |
---|
| 9 | app = QApplication(sys.argv) |
---|
| 10 | |
---|
| 11 | class 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 | |
---|
| 31 | if __name__ == "__main__": |
---|
| 32 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.