aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-16 13:52:09 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-06-17 15:34:34 -0300
commit83cf37f609ca3adb343be090054188dc254b9741 (patch)
tree7998ad2929a92f0d424c8166f70db1dcc40b716e /tests
parent4cca85f52585b17f53e26f81ca26504fe561e578 (diff)
Create unit-test for signal with QObject.
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.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
index d36665cf..1b1f2222 100644
--- a/tests/signals/signal_object_test.py
+++ b/tests/signals/signal_object_test.py
@@ -13,7 +13,7 @@ class MyObject(QTimer):
sig3 = Signal(int)
sig4 = Signal((int,), (unicode,))
sig5 = Signal((unicode,), (int,))
-
+ sig6 = Signal(QObject)
@Slot(int)
def myRange(self, r):
@@ -25,6 +25,9 @@ class MyObject(QTimer):
def slotString(self, s):
self._s = s
+ def slotObject(self, o):
+ self._o = o
+
class SignalObjectTest(UsesQCoreApplication):
def cb(self):
@@ -75,8 +78,12 @@ class SignalObjectTest(UsesQCoreApplication):
o.sig5[int].emit(10)
self.assertEqual(o._range, 10)
-
-
+ def testSignalWithObject(self):
+ o = MyObject()
+ o.sig6.connect(o.slotObject)
+ arg = QObject()
+ o.sig6.emit(arg)
+ self.assertEqual(arg, o._o)
if __name__ == '__main__':
unittest.main()