aboutsummaryrefslogtreecommitdiffstats
path: root/tests/signals
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-12-13 15:19:57 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:47:57 -0300
commitee8d6262dcceb4d594a01623c947e9186e985221 (patch)
tree187e4a39c799bd59c2986b873cb1f7e08a9fe0f5 /tests/signals
parent02e4fa2b963b35d3a5cd737e3887938afb6da1e7 (diff)
Fixed new style signal connection tests for the proper semantics.
One example to clarify: for the "destroyed(QObject* = 0)" signal, "obj.destroyed.connect(...)" connects to "destroyed()", and "obj.destroyed[QObject].connect(...)" connects to "destroyed(QObject*)". Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/signals')
-rw-r--r--tests/signals/signal_signature_test.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/signals/signal_signature_test.py b/tests/signals/signal_signature_test.py
index 785ebb806..001f7d6af 100644
--- a/tests/signals/signal_signature_test.py
+++ b/tests/signals/signal_signature_test.py
@@ -14,7 +14,7 @@ class Obj(QObject):
def connectNotify(self, signal):
self.signal = signal
-def callback():
+def callback(arg=None):
pass
class TestConnectNotifyWithNewStyleSignals(UsesQCoreApplication):
@@ -33,7 +33,11 @@ class TestConnectNotifyWithNewStyleSignals(UsesQCoreApplication):
def testNewStyle(self):
sender = Obj()
+
sender.destroyed.connect(callback)
+ self.assertEqual(sender.signal, SIGNAL('destroyed()'))
+
+ sender.destroyed[QObject].connect(callback)
self.assertEqual(sender.signal, SIGNAL('destroyed(QObject*)'))
if __name__ == '__main__':