Added all original pyside unit tests to the shiboken version.

This commit is contained in:
Hugo Lima 2009-09-21 14:51:26 -03:00
commit 9af36fbb64
160 changed files with 6616 additions and 12 deletions

View file

@ -0,0 +1,55 @@
#!/usr/bin/python
'''Test case for QObject.childEvent and QTimer.childEvent overloading'''
import unittest
from time import sleep
from PySide.QtCore import QObject, QTimer, QCoreApplication
from helper import UsesQCoreApplication
class ExtQObject(QObject):
def __init__(self):
QObject.__init__(self)
self.child_event_received = False
def childEvent(self, event):
QObject.childEvent(self, event)
self.child_event_received = True
class ExtQTimer(QTimer):
def __init__(self):
QTimer.__init__(self)
self.child_event_received = False
def childEvent(self, event):
QTimer.childEvent(self, event)
self.child_event_received = True
class TestChildEvent(UsesQCoreApplication):
'''Test case for QObject::childEvent and QTimer::childEvent'''
def setUp(self):
UsesQCoreApplication.setUp(self)
def tearDown(self):
UsesQCoreApplication.tearDown(self)
def testQObject(self):
parent = ExtQObject()
child = QObject()
child.setParent(parent)
print "parent seted"
#self.assert_(parent.child_event_received)
"""
def testQTimer(self):
parent = ExtQTimer()
child = QObject()
child.setParent(parent)
self.assert_(parent.child_event_received)
"""
if __name__ == '__main__':
unittest.main()