diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-08-16 11:48:50 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:44 -0300 |
commit | 8e1c2702f62e3bbb946879249c610f7181036f5a (patch) | |
tree | d6c6b5f46582d8d0610b02be976129e6d957f106 | |
parent | a17bf4130564d074023235bd5b99f95f86f79702 (diff) |
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.py | 12 |
1 files changed, 12 insertions, 0 deletions
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() |