aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-17 16:50:25 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-17 19:54:49 -0300
commit367536b2aad4c076141d6075b766c246a102d763 (patch)
tree0c9cdbda35ce258fdd5860a29e2c6517ac13f9fc /tests
parent77d9398bde09ed06ff0be94168c7c8739ec2483d (diff)
Removed init[slot,signal] from public api.
Use PyObject_dir to discovery signals methods. (this is very slow) 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.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
index d4a35dce..ead4b68b 100644
--- a/tests/signals/signal_object_test.py
+++ b/tests/signals/signal_object_test.py
@@ -5,8 +5,9 @@ import unittest
import functools
from PySide.QtCore import *
+from helper import UsesQCoreApplication
-class MyObject(QObject):
+class MyObject(QTimer):
sig1 = Signal()
sig2 = Signal(int, name='rangeChanged')
sig3 = Signal(int)
@@ -15,10 +16,8 @@ class MyObject(QObject):
@Slot(int)
def myRange(self, r):
- print "Range changed:", r
self._range = r
-
def slot1(self):
self._called = True
@@ -26,9 +25,10 @@ class MyObject(QObject):
self._s = s
-class SignalObjectTest(unittest.TestCase):
+class SignalObjectTest(UsesQCoreApplication):
def cb(self):
self._cb_called = True
+ self.app.exit()
def testsingleConnect(self):
o = MyObject()
@@ -55,8 +55,10 @@ class SignalObjectTest(unittest.TestCase):
def testGeneretedSignal(self):
o = MyObject()
- o.destroyed.connect(self.cb)
- self.assertEqual(self._cb_called)
+ o.timeout.connect(self.cb)
+ o.start(100)
+ self.app.exec_()
+ self.assert_(self._cb_called)
if __name__ == '__main__':
unittest.main()