aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-13 17:51:14 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:51:46 -0300
commitb57192c596230ef8fb6a9cb1fe51d3a72e719e4f (patch)
treebea1eb3f14e3b76101529cffc48683de9b352de9 /tests
parentd9940e55a41b83d30ce41e8002f614bfe16d54bf (diff)
Fix bug#584 - "python pickle module can't treat QByteArray object of PySide"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/qbytearray_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
index 34dc42f57..f031332d9 100644
--- a/tests/QtCore/qbytearray_test.py
+++ b/tests/QtCore/qbytearray_test.py
@@ -4,6 +4,8 @@
import unittest
import ctypes
import sys
+import pickle
+import cStringIO
from PySide.QtCore import *
@@ -109,5 +111,14 @@ class QByteArrayBug514(unittest.TestCase):
self.assertEqual(type(a), QByteArray)
self.assertEqual(a.data(), data)
+class TestPickler(unittest.TestCase):
+ def testIt(self):
+ ba = QByteArray("321\x00123")
+ output = cStringIO.StringIO()
+ pickle.dump(ba, output)
+ ba2 = pickle.loads(output.getvalue())
+ self.assertEqual(ba, ba2)
+
+
if __name__ == '__main__':
unittest.main()