summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-04 10:43:09 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-07-04 19:27:55 -0300
commitfd45794c3a5acbb99d35bd6add3ad59c3ed83907 (patch)
tree3b231448a040dd2cd775d17a2b3d28d8bb63da33 /tests
parent07285f0d283d5e8f729fbeef27550f1770e497a8 (diff)
downloadpyside-fd45794c3a5acbb99d35bd6add3ad59c3ed83907.tar.gz
pyside-fd45794c3a5acbb99d35bd6add3ad59c3ed83907.tar.xz
pyside-fd45794c3a5acbb99d35bd6add3ad59c3ed83907.zip
Created unit test for bug #909.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_909.py24
-rw-r--r--tests/QtUiTools/bug_909.ui31
3 files changed, 56 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 4c055ec..02fb89d 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -4,5 +4,6 @@ PYSIDE_TEST(bug_392.py)
PYSIDE_TEST(bug_426.py)
PYSIDE_TEST(bug_552.py)
PYSIDE_TEST(bug_797.py)
+PYSIDE_TEST(bug_909.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_909.py b/tests/QtUiTools/bug_909.py
new file mode 100644
index 0000000..18df7b3
--- /dev/null
+++ b/tests/QtUiTools/bug_909.py
@@ -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()
diff --git a/tests/QtUiTools/bug_909.ui b/tests/QtUiTools/bug_909.ui
new file mode 100644
index 0000000..b07f62d
--- /dev/null
+++ b/tests/QtUiTools/bug_909.ui
@@ -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>