From 3da60153c00c693454fe80f1b3420b872becc4dd Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Mon, 22 Aug 2011 14:32:58 -0300 Subject: Created unit test for __reduce__ of empty QColor. Reviewer: Luciano Wolf Lauro Neto --- tests/QtGui/qcolor_test.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/QtGui/qcolor_test.py b/tests/QtGui/qcolor_test.py index 29b0d5dbb..26f3f4cf7 100644 --- a/tests/QtGui/qcolor_test.py +++ b/tests/QtGui/qcolor_test.py @@ -3,7 +3,7 @@ import unittest import colorsys import PySide -from PySide.QtCore import Qt, qFuzzyCompare +from PySide.QtCore import Qt from PySide.QtGui import QColor @@ -69,6 +69,17 @@ class QColorCopy(unittest.TestCase): del original self.assertEqual(copy, QColor(0, 0, 255)) + def testEmptyCopy(self): + from copy import deepcopy + + original = QColor() + copy = deepcopy([original])[0] + self.assert_(original is not copy) + self.assertEqual(original, copy) + del original + self.assertEqual(copy, QColor()) + + class QColorRepr(unittest.TestCase): def testReprFunction(self): c = QColor(100, 120, 200) -- cgit v1.2.3