def test_protobuf_serializer(self): serializer = ProtobufSerializer(queueschema) headers, content = serializer.dump({}, protobuf) assert headers['Content-Type'] == 'application/x-protobuf' assert headers['X-Protobuf-FullName'] == protobuf.DESCRIPTOR.full_name assert content == protobuf.SerializeToString()
def test_protobuf_serializer(self): serializer = ProtobufSerializer(queueschema) headers, content = serializer.dump({}, protobuf) assert headers['Content-Type'] == 'application/x-protobuf' assert headers['X-Protobuf-FullName'] == protobuf.DESCRIPTOR.full_name assert content == protobuf.SerializeToString()
def test_protobuf_deserializer(self): serializer = ProtobufSerializer(queueschema) content = protobuf.SerializeToString() response = httplib2.Response({ 'status' : 200, 'content-type' : 'application/x-protobuf', 'x-protobuf-fullname' : protobuf.DESCRIPTOR.full_name, }) response, content = serializer.load(response, content) assert content.SerializeToString() == protobuf.SerializeToString()
def test_protobuf_deserializer(self): serializer = ProtobufSerializer(queueschema) content = protobuf.SerializeToString() response = httplib2.Response({ 'status': 200, 'content-type': 'application/x-protobuf', 'x-protobuf-fullname': protobuf.DESCRIPTOR.full_name, }) response, content = serializer.load(response, content) assert content.SerializeToString() == protobuf.SerializeToString()