aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/QtCore/qobject_connect_notify_test.py5
-rw-r--r--tests/signals/signal_signature_test.py11
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/QtCore/qobject_connect_notify_test.py b/tests/QtCore/qobject_connect_notify_test.py
index 629a79a6..50b748ca 100644
--- a/tests/QtCore/qobject_connect_notify_test.py
+++ b/tests/QtCore/qobject_connect_notify_test.py
@@ -69,7 +69,10 @@ class TestQObjectConnectNotify(UsesQCoreApplication):
receiver = QObject()
sender.connect(SIGNAL("destroyed()"), receiver, SLOT("deleteLater()"))
self.assertTrue(sender.con_notified)
- self.assertEqual(sender.signal, SIGNAL("destroyed()"))
+ # When connecting to a regular slot, and not a python callback function, QObject::connect
+ # will use the non-cloned method signature, so connecting to destroyed() will actually
+ # connect to destroyed(QObject*).
+ self.assertEqual(sender.signal.methodSignature(), "destroyed(QObject*)")
sender.disconnect(SIGNAL("destroyed()"), receiver, SLOT("deleteLater()"))
self.assertTrue(sender.dis_notified)
diff --git a/tests/signals/signal_signature_test.py b/tests/signals/signal_signature_test.py
index 8d60c17f..349619aa 100644
--- a/tests/signals/signal_signature_test.py
+++ b/tests/signals/signal_signature_test.py
@@ -52,21 +52,24 @@ class TestConnectNotifyWithNewStyleSignals(UsesQCoreApplication):
sender = Obj()
receiver = QObject()
sender.connect(SIGNAL('destroyed()'), receiver, SLOT('deleteLater()'))
- self.assertEqual(sender.signal, SIGNAL('destroyed()'))
+ # When connecting to a regular slot, and not a python callback function, QObject::connect
+ # will use the non-cloned method signature, so connectinc to destroyed() will actually
+ # connect to destroyed(QObject*).
+ self.assertEqual(sender.signal.methodSignature(), 'destroyed(QObject*)')
def testOldStyleWithPythonCallback(self):
sender = Obj()
sender.connect(SIGNAL('destroyed()'), callback)
- self.assertEqual(sender.signal, SIGNAL('destroyed()'))
+ self.assertEqual(sender.signal.methodSignature(), 'destroyed()')
def testNewStyle(self):
sender = Obj()
sender.destroyed.connect(callback)
- self.assertEqual(sender.signal, SIGNAL('destroyed()'))
+ self.assertEqual(sender.signal.methodSignature(), 'destroyed()')
sender.destroyed[QObject].connect(callback)
- self.assertEqual(sender.signal, SIGNAL('destroyed(QObject*)'))
+ self.assertEqual(sender.signal.methodSignature(), 'destroyed(QObject*)')
if __name__ == '__main__':
unittest.main()