Added all original pyside unit tests to the shiboken version.
This commit is contained in:
parent
aa12538d63
commit
9af36fbb64
160 changed files with 6616 additions and 12 deletions
37
tests/qtgui/parent_policy_test.py
Executable file
37
tests/qtgui/parent_policy_test.py
Executable 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()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue