summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-16 11:48:50 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-08-16 14:18:23 -0300
commit530ec26bea66e823d85ba61facb63282f0d83f4b (patch)
treecca61b1ebc10f67439f7107d7c920dc57dda7c08
parentbea3664c38c90e6b61886ee0bcde1236b725b373 (diff)
downloadpyside-530ec26bea66e823d85ba61facb63282f0d83f4b.tar.gz
pyside-530ec26bea66e823d85ba61facb63282f0d83f4b.tar.xz
pyside-530ec26bea66e823d85ba61facb63282f0d83f4b.zip
Created unit test for QColor.__repr__ and QColor.__str__ functions.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--tests/QtGui/qcolor_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/QtGui/qcolor_test.py b/tests/QtGui/qcolor_test.py
index 1a94728..29b0d5d 100644
--- a/tests/QtGui/qcolor_test.py
+++ b/tests/QtGui/qcolor_test.py
@@ -1,6 +1,7 @@
import unittest
import colorsys
+import PySide
from PySide.QtCore import Qt, qFuzzyCompare
from PySide.QtGui import QColor
@@ -68,5 +69,16 @@ class QColorCopy(unittest.TestCase):
del original
self.assertEqual(copy, QColor(0, 0, 255))
+class QColorRepr(unittest.TestCase):
+ def testReprFunction(self):
+ c = QColor(100, 120, 200)
+ c2 = eval(c.__repr__())
+ self.assertEqual(c, c2)
+
+ def testStrFunction(self):
+ c = QColor('red')
+ c2 = eval(c.__str__())
+ self.assertEqual(c, c2)
+
if __name__ == '__main__':
unittest.main()