source: sasview/src/sas/qtgui/UnitTesting/GuiManagerTest.py @ 5032ea68

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 5032ea68 was 5032ea68, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 8 years ago

threaded file load, data object related fixes, more unit tests.

  • Property mode set to 100755
File size: 1.8 KB
Line 
1import sys
2import unittest
3
4from PyQt4.QtGui import *
5from PyQt4.QtTest import QTest
6from PyQt4.QtCore import *
7from mock import MagicMock
8
9# Local
10from GuiManager import GuiManager
11from UI.MainWindowUI import MainWindow
12
13app = QApplication(sys.argv)
14
15class GuiManagerTest(unittest.TestCase):
16    '''Test the Main Window functionality'''
17    def setUp(self):
18        '''Create the tested object'''
19        class MainSasViewWindow(MainWindow):
20            # Main window of the application
21            def __init__(self, reactor, parent=None):
22                super(MainSasViewWindow, self).__init__(parent)
23       
24                # define workspace for dialogs.
25                self.workspace = QWorkspace(self)
26                self.setCentralWidget(self.workspace)
27
28        self.manager = GuiManager(MainSasViewWindow(None), None)
29
30    def tearDown(self):
31        '''Destroy the GUI'''
32        self.manager = None
33
34    def testDefaults(self):
35        '''Test the object in its default state'''
36        pass
37       
38    def testUpdatePerspective(self):
39        """
40        """
41        pass
42
43    def testUpdateStatusBar(self):
44        """
45        """
46        pass
47
48    def testSetData(self):
49        """
50        """
51        pass
52
53    def testSetData(self):
54        """
55        """
56        pass
57
58    def testActions(self):
59        """
60        """
61        pass
62
63    def testActionLoadData(self):
64        """
65        Menu File/Load Data File(s)
66        """
67        # Mock the system file open method
68        QFileDialog.getOpenFileName = MagicMock(return_value=None)
69
70        # invoke the action
71
72        # Test the getOpenFileName() dialog called once
73        #self.assertTrue(QtGui.QFileDialog.getOpenFileName.called)
74        #QtGui.QFileDialog.getOpenFileName.assert_called_once()
75       
76
77    # test each action separately
78       
79if __name__ == "__main__":
80    unittest.main()
81
Note: See TracBrowser for help on using the repository browser.