diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-08-12 16:41:14 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:43 -0300 |
commit | 44c67274f0ad3474ae373aab63012e46dac70114 (patch) | |
tree | b4f24954ee45fa8de9c684787cb99842fd5bc552 /tests | |
parent | bbf66078ea911cbacca69550da15fa21a000e3ab (diff) |
Created unit test for bug #965.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Lauro Neto <lauro.neto@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtUiTools/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtUiTools/bug_965.py | 20 | ||||
-rw-r--r-- | tests/QtUiTools/bug_965.ui | 27 |
3 files changed, 48 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt index 9acc9f35d..10fecd54b 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 000000000..4dbd281d6 --- /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 000000000..e324db829 --- /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> |