Fixed signal emission with pythonic signalture.
Created unittest.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
9ca3e6148a
commit
542095e1ee
2 changed files with 66 additions and 0 deletions
|
|
@ -15,6 +15,22 @@ class Dummy(QObject):
|
|||
def __init__(self, parent=None):
|
||||
QObject.__init__(self, parent)
|
||||
|
||||
def callDummy(self):
|
||||
self.emit(SIGNAL("dummy(PyObject)"), "PyObject")
|
||||
|
||||
|
||||
class PyObjectType(unittest.TestCase):
|
||||
def mySlot(self, arg):
|
||||
self.assertEqual(arg, "PyObject")
|
||||
self.called = True
|
||||
|
||||
def testType(self):
|
||||
self.called = False
|
||||
o = Dummy()
|
||||
o.connect(SIGNAL("dummy(PyObject)"), self.mySlot)
|
||||
o.callDummy()
|
||||
self.assert_(self.called)
|
||||
|
||||
class PythonSigSlot(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.called = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue