Created unit test to use signals in objects not created on python.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
27530522a8
commit
4c6e35634c
2 changed files with 28 additions and 0 deletions
27
tests/QtGui/qdynamic_signal.py
Normal file
27
tests/QtGui/qdynamic_signal.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
import unittest
|
||||
|
||||
from PySide.QtGui import QInputDialog
|
||||
|
||||
from helper import UsesQApplication
|
||||
|
||||
class DynamicSignalTest(UsesQApplication):
|
||||
|
||||
def cp(self, obj):
|
||||
self._called = True
|
||||
|
||||
def testQDialog(self):
|
||||
dlg = QInputDialog()
|
||||
dlg.setInputMode(QInputDialog.TextInput)
|
||||
lst = dlg.children()
|
||||
self.assert_(len(lst))
|
||||
obj = lst[0]
|
||||
self._called = False
|
||||
obj.destroyed.connect(self.cb)
|
||||
obj = None
|
||||
del dlg
|
||||
self.assert_(self._called)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue