6 from PyQt4
import QtGui
8 from test
.helper
import run_unittest
11 class AppTestCase(unittest
.TestCase
):
13 class MockQtGuiQApplication(object):
14 def __init__(self
, *args
):
17 class Mock_Session_Mgr(object):
24 class MockView(object):
25 def save_state(self
, *args
, **kwargs
):
29 super(AppTestCase
, self
).setUp()
30 self
.Store_QApplication
= QtGui
.QApplication
31 QtGui
.QApplication
= self
.MockQtGuiQApplication
34 super(AppTestCase
, self
).tearDown()
35 QtGui
.QApplication
= self
.Store_QApplication
37 def test_setup_environment(self
):
38 #If the function doesn't throw an exception we are happy.
39 app
.setup_environment()
43 return unittest
.makeSuite(AppTestCase
)
45 if __name__
== "__main__":
46 run_unittest(test_suite())