aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-14 17:14:49 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-17 19:53:54 -0300
commitd8593de73a7f8fdb71012d253f91de3878d29d5e (patch)
treec9a9e3bb27b9a30a2989cb69ab789fbbf7bafe14 /tests
parentc5fd4d4830cb49c9f8087d7e54335f4c248f76bf (diff)
Implemented signal name discovery if not setted on constructor.
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.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
index 89e114d6..a3dee57d 100644
--- a/tests/signals/signal_object_test.py
+++ b/tests/signals/signal_object_test.py
@@ -9,31 +9,36 @@ from PySide.QtCore import *
class MyObject(QObject):
sig1 = Signal()
sig2 = Signal(int, name='rangeChanged')
+ sig3 = Signal(int)
@Slot(int)
def myRange(self, r):
print "Range changed:", r
+ self._range = r
def slot1(self):
self._called = True
-
class SignalObjectTest(unittest.TestCase):
-
def testsingleConnect(self):
o = MyObject()
o.sig1.connect(o.slot1)
o.sig1.emit()
self.assert_(o._called)
+ def testSignalWithArgs(self):
+ o = MyObject()
+ o.sig3.connect(o.myRange)
+ o.sig3.emit(10)
+ self.assertEqual(o._range, 10)
+
def testSignatureParse(self):
o = MyObject()
o.sig2.connect(o.myRange)
o.sig2.emit(10)
-
if __name__ == '__main__':
unittest.main()