示例#1
0
 def test_binary_deserialize(self):
     """
     BinaryAttribute.deserialize
     """
     attr = BinaryAttribute()
     serial = b64encode(b'foo').decode(DEFAULT_ENCODING)
     assert attr.deserialize(serial) == b'foo'
示例#2
0
 def test_binary_deserialize(self):
     """
     BinaryAttribute.deserialize
     """
     attr = BinaryAttribute()
     serial = b64encode(b'foo').decode(DEFAULT_ENCODING)
     self.assertEqual(attr.deserialize(serial), b'foo')
示例#3
0
 def test_binary_round_trip(self):
     """
     BinaryAttribute round trip
     """
     attr = BinaryAttribute()
     value = b'foo'
     serial = attr.serialize(value)
     assert attr.deserialize(serial) == value
示例#4
0
 def test_binary_round_trip(self):
     """
     BinaryAttribute round trip
     """
     attr = BinaryAttribute()
     value = b'foo'
     serial = attr.serialize(value)
     self.assertEqual(attr.deserialize(serial), value)