diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-06-29 16:37:05 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-06-29 16:47:59 -0300 |
commit | 4c6e35634c220a9bc64b33db41a80360a3bc6e18 (patch) | |
tree | 5deb6dbecbde5c043faed311a4d6fcc077225958 /tests/QtGui | |
parent | 27530522a8b494874549f11bcdd2a56e685870ba (diff) |
Created unit test to use signals in objects not created on python.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/QtGui')
-rw-r--r-- | tests/QtGui/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtGui/qdynamic_signal.py | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index 3c9c2c3ae..02b7d4332 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -18,6 +18,7 @@ PYSIDE_TEST(qbrush_test.py) PYSIDE_TEST(qcolor_test.py) PYSIDE_TEST(qaction_test.py) PYSIDE_TEST(qdatastream_gui_operators_test.py) +PYSIDE_TEST(qdynamic_signal.py) PYSIDE_TEST(qfontdialog_test.py) PYSIDE_TEST(qfontmetrics_test.py) PYSIDE_TEST(qgraphicsitem_isblocked_test.py) diff --git a/tests/QtGui/qdynamic_signal.py b/tests/QtGui/qdynamic_signal.py new file mode 100644 index 000000000..db3218e50 --- /dev/null +++ b/tests/QtGui/qdynamic_signal.py @@ -0,0 +1,27 @@ + +import unittest + +from PySide.QtGui import QInputDialog + +from helper import UsesQApplication + +class DynamicSignalTest(UsesQApplication): + + def cp(self, obj): + self._called = True + + def testQDialog(self): + dlg = QInputDialog() + dlg.setInputMode(QInputDialog.TextInput) + lst = dlg.children() + self.assert_(len(lst)) + obj = lst[0] + self._called = False + obj.destroyed.connect(self.cb) + obj = None + del dlg + self.assert_(self._called) + + +if __name__ == '__main__': + unittest.main() |