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,25 @@
import unittest
from PySide.QtCore import QObject, QTimer, QThread
from PySide.QtGui import *
class Foo(QTableView):
def __init__(self, parent=None):
QTableView.__init__(self, parent)
from helper import UsesQApplication
class TestParentType(UsesQApplication):
def testParentType(self):
# Test the problem with calling QObject.parent from a QWidget
# when the parent is a python class derived from a QWidget-derived
# class. The method was returning the last C++ class in the hierarchy
parent = Foo()
w2 = QWidget(parent)
self.assert_(isinstance(w2.parentWidget(), Foo))
self.assert_(isinstance(w2.parent(), Foo))
if __name__ == '__main__':
unittest.main()