From 3adb054bbfa83530ca5a5fd54a856755fd72af83 Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Fri, 30 Jun 2017 17:22:32 -0700 Subject: add some test proto2 supported, add js proto2 supported, fixed some error --- conformance/conformance_python.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'conformance/conformance_python.py') diff --git a/conformance/conformance_python.py b/conformance/conformance_python.py index 62cfce87..c5ba2467 100755 --- a/conformance/conformance_python.py +++ b/conformance/conformance_python.py @@ -38,6 +38,8 @@ See conformance.proto for more information. import struct import sys import os +from google.protobuf import descriptor +from google.protobuf import descriptor_pool from google.protobuf import json_format from google.protobuf import message from google.protobuf import test_messages_proto3_pb2 @@ -54,15 +56,16 @@ class ProtocolError(Exception): pass def do_test(request): - isProto3 = (request.message_type == "protobuf_test_messages.proto3.TestAllTypes") + isProto3 = (request.message_type == "protobuf_test_messages.proto3.TestAllTypesProto3") isJson = (request.WhichOneof('payload') == 'json_payload') isProto2 = (request.message_type == "protobuf_test_messages.proto2.TestAllTypesProto2") if (not isProto3) and (not isJson) and (not isProto2): raise ProtocolError("Protobuf request doesn't have specific payload type") - + test_message = test_messages_proto2_pb2.TestAllTypesProto2() if isProto2 else \ - test_messages_proto3_pb2.TestAllTypes() + test_messages_proto3_pb2.TestAllTypesProto3() + response = conformance_pb2.ConformanceResponse() try: -- cgit v1.2.3