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:
parent
6545eb21f5
commit
ad023b3cb5
4 changed files with 62 additions and 0 deletions
26
tests/QtGui/bug_606.py
Normal file
26
tests/QtGui/bug_606.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import unittest
|
||||
|
||||
import PySide
|
||||
from PySide.QtGui import QVector2D, QVector3D, QVector4D
|
||||
from PySide.QtGui import QColor
|
||||
|
||||
class testCases(unittest.TestCase):
|
||||
def testQVector2DToTuple(self):
|
||||
vec = QVector2D(1, 2)
|
||||
self.assertEqual((1, 2), vec.toTuple())
|
||||
|
||||
def testQVector3DToTuple(self):
|
||||
vec = QVector3D(1, 2, 3)
|
||||
self.assertEqual((1, 2, 3), vec.toTuple())
|
||||
|
||||
def testQVector4DToTuple(self):
|
||||
vec = QVector4D(1, 2, 3, 4)
|
||||
self.assertEqual((1, 2, 3, 4), vec.toTuple())
|
||||
|
||||
def testQColorToTuple(self):
|
||||
c = QColor(0, 0, 255)
|
||||
c.setRgb(1, 2, 3)
|
||||
self.assertEqual((1, 2, 3, 255), c.toTuple())
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue