示例#1
0
 def deserialize(data):
     is_binary = data[Blob.SERIAL_IS_BINARY_KEY]
     c = Blob(is_binary=is_binary)
     c._compressed_bin = data[Blob.SERIAL_COMPRESSED_BIN_KEY]
     c._size = data.get(Blob.SERIAL_SIZE_KEY)
     #c.is_binary = data[Blob.SERIAL_IS_BINARY_KEY]
     c._sha = SHA.deserialize(data[Blob.SERIAL_SHA_KEY])
     return c
示例#2
0
文件: blob.py 项目: lasote/common
 def deserialize(data):
     is_binary = data[Blob.SERIAL_IS_BINARY_KEY]
     c = Blob(is_binary=is_binary)
     c._compressed_bin = data[Blob.SERIAL_COMPRESSED_BIN_KEY]
     c._size = data.get(Blob.SERIAL_SIZE_KEY)
     #c.is_binary = data[Blob.SERIAL_IS_BINARY_KEY]
     c._sha = SHA.deserialize(data[Blob.SERIAL_SHA_KEY])
     return c
 def test_sha(self):
     c = SHA('hola')
     s = c.serialize()
     c2 = SHA.deserialize(s)
     self.assertEqual(c, c2)
示例#4
0
 def test_sha(self):
     c = SHA('hola')
     s = c.serialize()
     c2 = SHA.deserialize(s)
     self.assertEqual(c, c2)