browse: avoid using QStandardItem as dictionary keys
[git-cola.git] / test / app_test.py
blob50b9196b05695da66137e4e8dac215202b0db23f
1 #!/usr/bin/env python
2 import unittest
4 from cola import app
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):
15 pass
17 class Mock_Session_Mgr(object):
18 def sessionId(self):
19 return 'junk_string'
21 def sessionKey(self):
22 return 'junk_string'
24 class MockView(object):
25 def save_state(self, *args, **kwargs):
26 pass
28 def setUp(self):
29 super(AppTestCase, self).setUp()
30 self.Store_QApplication = QtGui.QApplication
31 QtGui.QApplication = self.MockQtGuiQApplication
33 def tearDown(self):
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()
42 def test_suite():
43 return unittest.makeSuite(AppTestCase)
45 if __name__ == "__main__":
46 run_unittest(test_suite())