Fix round problems on unit test.
This commit is contained in:
parent
04a2f23988
commit
406293f5aa
1 changed files with 5 additions and 5 deletions
|
|
@ -21,23 +21,23 @@ class ReturnsQuadruplesOfNumbers(UsesQApplication):
|
||||||
obj = GraphicsLayout()
|
obj = GraphicsLayout()
|
||||||
values = (10.0, 20.0, 30.0, 40.0)
|
values = (10.0, 20.0, 30.0, 40.0)
|
||||||
obj.setContentsMargins(*values)
|
obj.setContentsMargins(*values)
|
||||||
self.assertEquals(obj.getContentsMargins(), values)
|
self.assertEquals(round(obj.getContentsMargins()), values)
|
||||||
|
|
||||||
def testQGraphicsLayoutItemGetContentsMargins(self):
|
def testQGraphicsLayoutItemGetContentsMargins(self):
|
||||||
obj = GraphicsLayoutItem()
|
obj = GraphicsLayoutItem()
|
||||||
self.assertEquals(obj.getContentsMargins(), (0.0, 0.0, 0.0, 0.0))
|
self.assertEquals(round(obj.getContentsMargins()), (0.0, 0.0, 0.0, 0.0))
|
||||||
|
|
||||||
def testQWidgetGetContentsMargins(self):
|
def testQWidgetGetContentsMargins(self):
|
||||||
obj = QWidget()
|
obj = QWidget()
|
||||||
values = (10, 20, 30, 40)
|
values = (10, 20, 30, 40)
|
||||||
obj.setContentsMargins(*values)
|
obj.setContentsMargins(*values)
|
||||||
self.assertEquals(obj.getContentsMargins(), values)
|
self.assertEquals(round(obj.getContentsMargins()), values)
|
||||||
|
|
||||||
def testQLayoutGetContentsMargins(self):
|
def testQLayoutGetContentsMargins(self):
|
||||||
obj = Layout()
|
obj = Layout()
|
||||||
values = (10, 20, 30, 40)
|
values = (10, 20, 30, 40)
|
||||||
obj.setContentsMargins(*values)
|
obj.setContentsMargins(*values)
|
||||||
self.assertEquals(obj.getContentsMargins(), values)
|
self.assertEquals(round(obj.getContentsMargins()), values)
|
||||||
|
|
||||||
def testQTextCursorSelectedTableCells(self):
|
def testQTextCursorSelectedTableCells(self):
|
||||||
obj = QTextCursor()
|
obj = QTextCursor()
|
||||||
|
|
@ -48,7 +48,7 @@ class ReturnsQuadruplesOfNumbers(UsesQApplication):
|
||||||
obj = QPrinter()
|
obj = QPrinter()
|
||||||
values = (10.0, 20.0, 30.0, 40.0, QPrinter.Point)
|
values = (10.0, 20.0, 30.0, 40.0, QPrinter.Point)
|
||||||
obj.setPageMargins(*values)
|
obj.setPageMargins(*values)
|
||||||
self.assertEquals(obj.getPageMargins(QPrinter.Point), values[:-1])
|
self.assertEquals(round(obj.getPageMargins(QPrinter.Point)), values[:-1])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue