summaryrefslogtreecommitdiffstats
path: root/tests/QtUiTools
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-12 16:41:14 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-08-12 18:59:10 -0300
commit0e0b99f43a2f7352a490551d4fde85122caac6b6 (patch)
tree44c3f1ab7cef8379abf5feae98ab2a39e0bec558 /tests/QtUiTools
parentb261ff4642d4c4cc7e33862c3ea1477e3e6d89fc (diff)
downloadpyside-0e0b99f43a2f7352a490551d4fde85122caac6b6.tar.gz
pyside-0e0b99f43a2f7352a490551d4fde85122caac6b6.tar.xz
pyside-0e0b99f43a2f7352a490551d4fde85122caac6b6.zip
Created unit test for bug #965.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
Diffstat (limited to 'tests/QtUiTools')
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_965.py20
-rw-r--r--tests/QtUiTools/bug_965.ui27
3 files changed, 48 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 9acc9f3..10fecd5 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -6,5 +6,6 @@ PYSIDE_TEST(bug_552.py)
PYSIDE_TEST(bug_797.py)
PYSIDE_TEST(bug_909.py)
PYSIDE_TEST(bug_913.py)
+PYSIDE_TEST(bug_965.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_965.py b/tests/QtUiTools/bug_965.py
new file mode 100644
index 0000000..4dbd281
--- /dev/null
+++ b/tests/QtUiTools/bug_965.py
@@ -0,0 +1,20 @@
+from PySide.QtUiTools import QUiLoader
+import unittest
+
+from helper import UsesQApplication
+from helper import adjust_filename
+
+class MyQUiLoader(QUiLoader):
+ def __init__(self):
+ super(MyQUiLoader, self).__init__()
+
+ def createWidget(self, className, parent=None, name=""):
+ return None
+
+class BugTest(UsesQApplication):
+ def testCase(self):
+ loader = MyQUiLoader()
+ self.assertRaises(RuntimeError, loader.load, adjust_filename('bug_965.ui', __file__))
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/QtUiTools/bug_965.ui b/tests/QtUiTools/bug_965.ui
new file mode 100644
index 0000000..e324db8
--- /dev/null
+++ b/tests/QtUiTools/bug_965.ui
@@ -0,0 +1,27 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="objectName" >
+ <string notr="true" >MainWindow</string>
+ </property>
+ <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="QMenuBar" name="menubar" />
+ <widget class="QWidget" name="centralwidget" />
+ <widget class="QStatusBar" name="statusbar" />
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <connections/>
+</ui>