aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/returnquadruplesofnumbers_test.py
blob: fad622e8fb640cea2253d7bc74aea2bbdda7cf51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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()