summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-21 17:46:40 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-07-22 11:51:44 -0300
commit2535688f04b97cda65f617c226ed4bc2096db0cc (patch)
treea201c3cb9755f2369b11b609a5c10e073888a989
parent55fb3a133d860523e289d8a56bf7ab05bbd404d6 (diff)
downloadpyside-2535688f04b97cda65f617c226ed4bc2096db0cc.tar.gz
pyside-2535688f04b97cda65f617c226ed4bc2096db0cc.tar.xz
pyside-2535688f04b97cda65f617c226ed4bc2096db0cc.zip
Update unit test for max signals.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
-rw-r--r--tests/QtCore/max_signals.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/QtCore/max_signals.py b/tests/QtCore/max_signals.py
index 190eaa5..154eac4 100644
--- a/tests/QtCore/max_signals.py
+++ b/tests/QtCore/max_signals.py
@@ -1,32 +1,34 @@
import unittest
-from PySide.QtCore import QObject, Signal, SIGNAL
+from PySide.QtCore import QObject, SIGNAL
class MyObject(QObject):
pass
class TestSignalLimitless(unittest.TestCase):
+ SIGNAL_MAX = 100
def test100DynamicSignals(self):
+
self.count = 0
def onSignal():
self.count += 1
#create 100 dynamic signals
o = MyObject()
- for i in range(100):
+ for i in range(self.SIGNAL_MAX):
o.connect(SIGNAL('sig%d()'%i), onSignal)
#chek if the signals are valid
m = o.metaObject()
- for i in range(100):
+ for i in range(self.SIGNAL_MAX):
self.assert_(m.indexOfSignal('sig%d()'%i) > 0)
#emit all 100 signals
- for i in range(100):
+ for i in range(self.SIGNAL_MAX):
o.emit(SIGNAL('sig%d()'%i))
- self.assertEqual(self.count, 100)
+ self.assertEqual(self.count, self.SIGNAL_MAX)
if __name__ == '__main__':
unittest.main()