aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pysidetest/application_test.py
blob: 39a8283791f3ec9b4e11ee5887bde31f180d7e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python

import unittest
from testbinding import TestObject
from PySide.QtGui import QApplication

class QApplicationInstance(unittest.TestCase):

    def appDestroyed(self):
        sefl.assert_(False)

    def testInstanceObject(self):
        TestObject.createApp()
        app1 = QApplication.instance()
        app2 = QApplication.instance()
        app1.setObjectName("MyApp")
        self.assertEqual(app1, app2)
        self.assertEqual(app2.objectName(), app1.objectName())
        app1.destroyed.connect(self.appDestroyed)

if __name__ == '__main__':
    unittest.main()