summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-22 14:32:58 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:46 -0300
commit3da60153c00c693454fe80f1b3420b872becc4dd (patch)
treed7338627cfd837b5609b205c9256d1643f04e08d
parent4fdc15ef7f11956e4f0bf34fce60f8aa0252eace (diff)
Created unit test for __reduce__ of empty QColor.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
-rw-r--r--tests/QtGui/qcolor_test.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/QtGui/qcolor_test.py b/tests/QtGui/qcolor_test.py
index 29b0d5db..26f3f4cf 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)