aboutsummaryrefslogtreecommitdiffstats
path: root/tests/signals
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-09-14 14:06:42 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-09-14 18:31:24 -0300
commit3edeee197ac061b3dbd861d63baf489f9031a96d (patch)
tree79af590d1a0ce5fcfd18940e51b36c84cb8b6b83 /tests/signals
parent42f917666904f4eb93002eae2de70d1f225f438f (diff)
Created unit test for bug #312.
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/signals')
-rw-r--r--tests/signals/CMakeLists.txt1
-rw-r--r--tests/signals/bug_312.py23
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index 5849dc55c..eaa9a84d1 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -1,5 +1,6 @@
PYSIDE_TEST(args_dont_match_test.py)
PYSIDE_TEST(bug_311.py)
+PYSIDE_TEST(bug_312.py)
PYSIDE_TEST(bug_319.py)
PYSIDE_TEST(decorators_test.py)
PYSIDE_TEST(invalid_callback_test.py)
diff --git a/tests/signals/bug_312.py b/tests/signals/bug_312.py
new file mode 100644
index 000000000..223b4e143
--- /dev/null
+++ b/tests/signals/bug_312.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest
+from PySide.QtCore import QObject, SIGNAL
+
+class MultipleSlots(unittest.TestCase):
+ def myCB(self):
+ self._count += 1
+
+ def testUnboundSignal(self):
+ o = QObject()
+ self._count = 0
+ for i in range(200):
+ QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB())
+
+ o.emit(SIGNAL("fire()"))
+ self.assertEqual(self._count, 200)
+
+if __name__ == '__main__':
+ unittest.main()
+
+