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,37 @@
#!/usr/bin/env python
import unittest
from helper import UsesQApplication
from PySide.QtCore import QAbstractTableModel, QVariant
from PySide.QtGui import QTableView
class TestModel(QAbstractTableModel):
def __init__(self, parent=None):
QAbstractTableModel.__init__(self, parent)
def rowCount(self, parent):
return 0
def columnCount(self, parent):
return 0
def data(self, index, role):
return QVariant()
class ParentPolicyTest(UsesQApplication):
def testModelWithoutParent(self):
view = QTableView()
model = TestModel()
view.setModel(model)
samemodel = view.model()
self.assertEqual(model, samemodel)
def testModelWithParent(self):
view = QTableView()
model = TestModel(self.app)
view.setModel(model)
samemodel = view.model()
self.assertEqual(model, samemodel)
if __name__ == '__main__':
unittest.main()