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>
This commit is contained in:
parent
d9940e55a4
commit
b57192c596
4 changed files with 33 additions and 25 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue