aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-04-06 20:51:04 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:07 -0300
commit8b1f0d192a8295b9aac9bfa876fba5674014b91d (patch)
tree2a0d37a3ee8b0c4e684957370a7e43f4fcaa9a69 /tests
parent00f0ea88cfd1020ff3765597ca9525eb73a783b2 (diff)
Fixes bugs 744, 745, 756, 758 and 764.
Bug #744 - Method "void QGraphicsLayout::getContentsMargins(qreal*,qreal*,qreal*,qreal*) const" missing Bug #745 - Method "void QGraphicsLayoutItem::getContentsMargins(qreal*,qreal*,qreal*,qreal*) const" missing Bug #756 - Method "void QWidget::getContentsMargins(int*,int*,int*,int*) const" missing Bug #758 - Method "void QTextCursor::selectedTableCells(int*,int*,int*,int*) const" missing Bug #764 - Method "void QLayout::getContentsMargins(int*,int*,int*,int*) const" missing Also added unit tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/returnquadruplesofnumbers_test.py48
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 9306efdcc..ef62638fc 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -110,6 +110,7 @@ PYSIDE_TEST(qwidget_setlayout_test.py)
PYSIDE_TEST(qwidget_test.py)
PYSIDE_TEST(reference_count_test.py)
PYSIDE_TEST(repr_test.py)
+PYSIDE_TEST(returnquadruplesofnumbers_test.py)
PYSIDE_TEST(standardpixmap_test.py)
PYSIDE_TEST(timed_app_test.py)
PYSIDE_TEST(virtual_protected_inheritance_test.py)
diff --git a/tests/QtGui/returnquadruplesofnumbers_test.py b/tests/QtGui/returnquadruplesofnumbers_test.py
new file mode 100644
index 000000000..fad622e8f
--- /dev/null
+++ b/tests/QtGui/returnquadruplesofnumbers_test.py
@@ -0,0 +1,48 @@
+import unittest
+from PySide.QtGui import QLayout, QWidget, QGraphicsLayout, QGraphicsLayoutItem, QTextCursor
+
+from helper import UsesQApplication
+
+class Layout(QLayout):
+ def __init__(self):
+ QLayout.__init__(self)
+
+class GraphicsLayout(QGraphicsLayout):
+ def __init__(self):
+ QGraphicsLayout.__init__(self)
+
+class GraphicsLayoutItem(QGraphicsLayoutItem):
+ def __init__(self):
+ QGraphicsLayoutItem.__init__(self)
+
+class ReturnsQuadruplesOfNumbers(UsesQApplication):
+
+ def testQGraphicsLayoutGetContentsMargins(self):
+ obj = GraphicsLayout()
+ values = (10.0, 20.0, 30.0, 40.0)
+ obj.setContentsMargins(*values)
+ self.assertEquals(obj.getContentsMargins(), values)
+
+ def testQGraphicsLayoutItemGetContentsMargins(self):
+ obj = GraphicsLayoutItem()
+ self.assertEquals(obj.getContentsMargins(), (0.0, 0.0, 0.0, 0.0))
+
+ def testQWidgetGetContentsMargins(self):
+ obj = QWidget()
+ values = (10, 20, 30, 40)
+ obj.setContentsMargins(*values)
+ self.assertEquals(obj.getContentsMargins(), values)
+
+ def testQLayoutGetContentsMargins(self):
+ obj = Layout()
+ values = (10, 20, 30, 40)
+ obj.setContentsMargins(*values)
+ self.assertEquals(obj.getContentsMargins(), values)
+
+ def testQTextCursorSelectedTableCells(self):
+ obj = QTextCursor()
+ self.assertEquals(obj.selectedTableCells(), (-1, -1, -1, -1))
+
+if __name__ == "__main__":
+ unittest.main()
+