Create unit tests for bug #606

Signed-off-by: Paulo Alcantara <paulo.alcantara@openbossa.org>

Reviewer: Lauro Moura <lauro.neto@openbossa.org>
          Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
Paulo Alcantara 2011-05-10 16:31:42 -03:00 committed by Renato Filho
commit 5a408b2b9d
4 changed files with 62 additions and 0 deletions

View file

@ -5,6 +5,7 @@ PYSIDE_TEST(bug_428.py)
PYSIDE_TEST(bug_462.py)
PYSIDE_TEST(bug_505.py)
PYSIDE_TEST(bug_515.py)
PYSIDE_TEST(bug_606.py)
PYSIDE_TEST(bug_656.py)
PYSIDE_TEST(bug_699.py)
PYSIDE_TEST(bug_706.py)

34
tests/QtCore/bug_606.py Normal file
View file

@ -0,0 +1,34 @@
import unittest
import PySide
from PySide.QtCore import QPoint, QPointF
from PySide.QtCore import QLine, QLineF
from PySide.QtCore import QSize, QSizeF
class testCases(unittest.TestCase):
def testQPointToTuple(self):
p = QPoint(1, 2)
self.assertEqual((1, 2), p.toTuple())
def testQPointFToTuple(self):
p = QPointF(1, 2)
self.assertEqual((1, 2), p.toTuple())
def testQLineToTuple(self):
l = QLine(1, 2, 3, 4)
self.assertEqual((1, 2, 3, 4), l.toTuple())
def testQLineFToTuple(self):
l = QLineF(1, 2, 3, 4)
self.assertEqual((1, 2, 3, 4), l.toTuple())
def testQSizeToTuple(self):
s = QSize(1, 2)
self.assertEqual((1, 2), s.toTuple())
def testQSizeFToTuple(self):
s = QSizeF(1, 2)
self.assertEqual((1, 2), s.toTuple())
if __name__ == '__main__':
unittest.main()