� S�Ljc@s�dZyddlmZWn!ek r=ddlmZnXyddlZWnek rmddlZnXddlmZddlm Z ddlm Z ddlm Z dej fd ��YZ ed kr�ej�ndS( s(Tests for google.protobuf.proto_builder.i����(t OrderedDictN(tdescriptor_pb2(tdescriptor_pool(t proto_builder(t text_formattProtoBuilderTestcBs,eZd�Zd�Zd�Zd�ZRS(cCsCtdtjjfdtjjfg�|_t|j�|_dS(Ntfootbar(RRtFieldDescriptorProtot TYPE_INT64t TYPE_STRINGtordered_fieldstdictt_fields(tself((sO/usr/lib/python2.7/site-packages/google/protobuf/internal/proto_builder_test.pytsetUp3scCsPtj|jdd�}|�}d|_d|_|jdtj|��dS(s&Test that we can create a proto class.t full_names0net.proto2.python.public.proto_builder_test.Testi90tasdfsbar: "asdf" foo: 12345 N(RtMakeSimpleProtoClassR RRtassertMultiLineEqualRtMessageToString(Rt proto_clstproto((sO/usr/lib/python2.7/site-packages/google/protobuf/internal/proto_builder_test.pyttestMakeSimpleProtoClass:s     cCsPtj|jdd�}|�}d|_d|_|jdtj|��dS(sBTest that the field order is maintained when given an OrderedDict.Rs7net.proto2.python.public.proto_builder_test.OrderedTesti90Rsfoo: 12345 bar: "asdf" N(RRR RRRRR(RRR((sO/usr/lib/python2.7/site-packages/google/protobuf/internal/proto_builder_test.pyttestOrderedFieldsEs     cCsbtj�}tj|jddd|�}tj|jddd|�}|j|j|j�dS(s%Test that the DescriptorPool is used.Rs0net.proto2.python.public.proto_builder_test.TesttpoolN(RtDescriptorPoolRRR tassertIst DESCRIPTOR(RRt proto_cls1t proto_cls2((sO/usr/lib/python2.7/site-packages/google/protobuf/internal/proto_builder_test.pyttestMakeSameProtoClassTwicePs     (t__name__t __module__RRRR(((sO/usr/lib/python2.7/site-packages/google/protobuf/internal/proto_builder_test.pyR1s  t__main__(t__doc__t collectionsRt ImportErrort ordereddictt unittest2tunittesttgoogle.protobufRRRRtTestCaseRR tmain(((sO/usr/lib/python2.7/site-packages/google/protobuf/internal/proto_builder_test.pyt s  -