aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-04-09 17:49:31 -0300
committerLauro Neto <lauro.neto@openbossa.org>2010-04-09 17:58:09 -0300
commit965a16322bade4098b8fe187296e62b746d6b590 (patch)
tree801d060912605204b2ade26ef9059dab1ea401da /tests
parentfbf8774f5833bd7f864d3919e843a857f21f1fb5 (diff)
Adding test for multiple QObject inheritance
Reviewer: Hugo Lima <hugo.lima@openbossa.org> Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtgui/qobject_mi_test.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/qtgui/qobject_mi_test.py b/tests/qtgui/qobject_mi_test.py
new file mode 100644
index 000000000..8ccc1d35d
--- /dev/null
+++ b/tests/qtgui/qobject_mi_test.py
@@ -0,0 +1,37 @@
+'''Test cases for multiple inheritance from 2 QObjects'''
+
+import unittest
+
+from PySide.QtCore import QObject
+from PySide.QtGui import *
+
+from helper import UsesQApplication
+
+class WidgetValidator(QWidget, QIntValidator):
+ def __init__(self, parent=None):
+ QWidget.__init__(self, parent)
+ QIntValidator.__init__(self, parent)
+
+
+class DoubleQObjectInheritanceTest(UsesQApplication):
+
+ def testDouble(self):
+ '''Double inheritance from QObject classes'''
+
+ obj = WidgetValidator()
+
+ #QObject methods
+ obj.setObjectName('aaaa')
+ self.assertEqual(obj.objectName(), 'aaaa')
+
+ #QWidget methods
+ obj.setVisible(False)
+ self.assertFalse(obj.isVisible())
+
+ #QIntValidator methods
+ self.assertEqual(obj.validate('aaaa', 0), QValidator.Invalid)
+ self.assertEqual(obj.validate('33', 0), QValidator.Acceptable)
+
+
+if __name__ == '__main__':
+ unittest.main()