From 8e1c2702f62e3bbb946879249c610f7181036f5a Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Tue, 16 Aug 2011 11:48:50 -0300 Subject: Created unit test for QColor.__repr__ and QColor.__str__ functions. Reviewer: Marcelo Lira Luciano Wolf --- tests/QtGui/qcolor_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/QtGui/qcolor_test.py b/tests/QtGui/qcolor_test.py index 1a9472894..29b0d5dbb 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() -- cgit v1.2.3