Created unit test for bug #909.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
07285f0d28
commit
fd45794c3a
3 changed files with 56 additions and 0 deletions
|
|
@ -4,5 +4,6 @@ PYSIDE_TEST(bug_392.py)
|
||||||
PYSIDE_TEST(bug_426.py)
|
PYSIDE_TEST(bug_426.py)
|
||||||
PYSIDE_TEST(bug_552.py)
|
PYSIDE_TEST(bug_552.py)
|
||||||
PYSIDE_TEST(bug_797.py)
|
PYSIDE_TEST(bug_797.py)
|
||||||
|
PYSIDE_TEST(bug_909.py)
|
||||||
PYSIDE_TEST(uiloader_test.py)
|
PYSIDE_TEST(uiloader_test.py)
|
||||||
PYSIDE_TEST(ui_test.py)
|
PYSIDE_TEST(ui_test.py)
|
||||||
|
|
|
||||||
24
tests/QtUiTools/bug_909.py
Normal file
24
tests/QtUiTools/bug_909.py
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from PySide.QtCore import QFile
|
||||||
|
from PySide.QtGui import QTabWidget
|
||||||
|
from PySide.QtUiTools import QUiLoader
|
||||||
|
|
||||||
|
from helper import UsesQApplication
|
||||||
|
from helper import adjust_filename
|
||||||
|
|
||||||
|
class TestDestruction(UsesQApplication):
|
||||||
|
def testBug909(self):
|
||||||
|
fileName = QFile(adjust_filename('bug_909.ui', __file__))
|
||||||
|
loader = QUiLoader()
|
||||||
|
main_win = loader.load(fileName)
|
||||||
|
self.assertEqual(sys.getrefcount(main_win), 2)
|
||||||
|
fileName.close()
|
||||||
|
|
||||||
|
tw = QTabWidget(main_win)
|
||||||
|
main_win.setCentralWidget(tw)
|
||||||
|
main_win.show()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
31
tests/QtUiTools/bug_909.ui
Normal file
31
tests/QtUiTools/bug_909.ui
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget"/>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue