summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-15 19:01:22 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-07-19 10:08:10 -0300
commit628f2038024f1ee561287ca14fd00965f7c24e0e (patch)
tree7ea122908e418e755043a5f32c1088e36fb02c50
parentb10a254814f3021489ade6ab626f5b6675f86858 (diff)
downloadpyside-628f2038024f1ee561287ca14fd00965f7c24e0e.tar.gz
pyside-628f2038024f1ee561287ca14fd00965f7c24e0e.tar.xz
pyside-628f2038024f1ee561287ca14fd00965f7c24e0e.zip
Created unit test for bug #921.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_921.py52
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 2c99cf1..d3048a3 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -17,6 +17,7 @@ PYSIDE_TEST(bug_826.py)
PYSIDE_TEST(bug_829.py)
PYSIDE_TEST(bug_835.py)
PYSIDE_TEST(bug_920.py)
+PYSIDE_TEST(bug_921.py)
PYSIDE_TEST(bug_927.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(classinfo_test.py)
diff --git a/tests/QtCore/bug_921.py b/tests/QtCore/bug_921.py
new file mode 100644
index 0000000..b43f5b3
--- /dev/null
+++ b/tests/QtCore/bug_921.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+
+import unittest
+
+import PySide.QtCore as QtCore
+import PySide.QtGui as QtGui
+
+from helper import TimedQApplication
+
+class Signaller(QtCore.QObject):
+ s1 = QtCore.Signal()
+ s2 = QtCore.Signal()
+ s3 = QtCore.Signal()
+
+class Window(object):
+
+ def __init__(self, s):
+ self._window = QtGui.QMainWindow()
+ self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
+ self._window.setWindowTitle("Demo!")
+
+ self._s = s
+ self._s.s1.connect(self._on_signal)
+ self._s.s2.connect(self._on_signal)
+
+ def show(self):
+ self._window.show()
+
+ def _on_signal(self):
+ self._window.setWindowTitle("Signaled!")
+
+class TestTimedApp(TimedQApplication):
+ def testSignals(self):
+ s = Signaller()
+ w = Window(s)
+ w.show()
+
+ def midleFunction():
+ def internalFunction():
+ pass
+ s.s3.connect(internalFunction)
+
+ midleFunction()
+ self.app.exec_()
+ del w
+
+ s.s1.emit()
+ s.s2.emit()
+ s.s3.emit()
+
+if __name__ == '__main__':
+ unittest.main()