From b57192c596230ef8fb6a9cb1fe51d3a72e719e4f Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Thu, 13 Jan 2011 17:51:14 -0200 Subject: Fix bug#584 - "python pickle module can't treat QByteArray object of PySide" Reviewer: Luciano Wolf Lauro Moura --- tests/QtCore/qbytearray_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/QtCore') 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() -- cgit v1.2.3