aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-14 19:05:51 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-17 19:54:16 -0300
commit5eabe6943ff7f6fe0a4e4b008f4664361354441a (patch)
tree5c027dadf3a38a5dc00dcfe2dca00a72b43f07d9 /tests
parentd8593de73a7f8fdb71012d253f91de3878d29d5e (diff)
Implemente sequence operator on signal class.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/signals/signal_object_test.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
index a3dee57d..49ab5a4f 100644
--- a/tests/signals/signal_object_test.py
+++ b/tests/signals/signal_object_test.py
@@ -10,6 +10,7 @@ class MyObject(QObject):
sig1 = Signal()
sig2 = Signal(int, name='rangeChanged')
sig3 = Signal(int)
+ sig4 = Signal((int,), (QString,))
@Slot(int)
@@ -21,6 +22,9 @@ class MyObject(QObject):
def slot1(self):
self._called = True
+ def slotString(self, s):
+ self._s = s
+
class SignalObjectTest(unittest.TestCase):
def testsingleConnect(self):
@@ -40,5 +44,11 @@ class SignalObjectTest(unittest.TestCase):
o.sig2.connect(o.myRange)
o.sig2.emit(10)
+ def testDictOperator(self):
+ o = MyObject()
+ o.sig4[QString].connect(o.slotString)
+ o.sig4[QString].emit("PySide")
+ self.assertEqual(o._s, "PySide")
+
if __name__ == '__main__':
unittest.main()