summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-29 16:37:05 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-06-29 16:47:59 -0300
commit4c6e35634c220a9bc64b33db41a80360a3bc6e18 (patch)
tree5deb6dbecbde5c043faed311a4d6fcc077225958 /tests
parent27530522a8b494874549f11bcdd2a56e685870ba (diff)
downloadpyside-4c6e35634c220a9bc64b33db41a80360a3bc6e18.tar.gz
pyside-4c6e35634c220a9bc64b33db41a80360a3bc6e18.tar.xz
pyside-4c6e35634c220a9bc64b33db41a80360a3bc6e18.zip
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')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/qdynamic_signal.py27
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 3c9c2c3..02b7d43 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 0000000..db3218e
--- /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()