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
31
tests/qtgui/qtoolbox_test.py
Normal file
31
tests/qtgui/qtoolbox_test.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
import unittest
|
||||
|
||||
from PySide.QtGui import QToolBox, QWidget, QIcon
|
||||
|
||||
from helper import UsesQApplication
|
||||
|
||||
class OwnershipControl(UsesQApplication):
|
||||
|
||||
def setUp(self):
|
||||
super(OwnershipControl, self).setUp()
|
||||
self.toolbox = QToolBox()
|
||||
|
||||
def tearDown(self):
|
||||
del self.toolbox
|
||||
super(OwnershipControl, self).tearDown()
|
||||
|
||||
def testAddItem(self):
|
||||
# Was losing ownership of the widget.
|
||||
index = self.toolbox.addItem(QWidget(), 'item')
|
||||
item = self.toolbox.widget(index)
|
||||
self.assert_(isinstance(item, QWidget))
|
||||
|
||||
def testAddItemWithIcon(self):
|
||||
index = self.toolbox.addItem(QWidget(), QIcon(), 'item')
|
||||
item = self.toolbox.widget(index)
|
||||
self.assert_(isinstance(item, QWidget))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue