diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-13 17:51:14 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:51:46 -0300 |
commit | b57192c596230ef8fb6a9cb1fe51d3a72e719e4f (patch) | |
tree | bea1eb3f14e3b76101529cffc48683de9b352de9 /tests | |
parent | d9940e55a41b83d30ce41e8002f614bfe16d54bf (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.py | 11 |
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() |