AlkantarClanX12

Your IP : 13.59.112.169


Current Path : /lib/python2.7/site-packages/google/protobuf/internal/
Upload File :
Current File : //lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyc

�
Du�ac@s�dZdZddlZyddlZWnek
rGddlZnXddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZdZdejfd��YZdefd��YZdejfd��YZdejfd��YZdejfd��YZedkr�ej�ndS(s1Unittest for google.protobuf.internal.descriptor.s#robinson@google.com (Will Robinson)i����N(tunittest_custom_options_pb2(tunittest_import_pb2(tunittest_pb2(tdescriptor_pb2(tapi_implementation(t	test_util(t
descriptor(tdescriptor_pool(tsymbol_database(ttext_formats
name: 'TestEmptyMessage'
tDescriptorTestcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zejej�dkp�ej�dkd�d��ZRS(c	Cs�tjdddd�}|jjdd�}|jjddddd	tjjd
tjj�|jjdd�}|j	jdddd
�|j	jdddd�|j	jdddd�|jjdd�|j
jdd�}|jjdddddd�}|j�|_
|j
j|�|j
j|j�|_|jj|j|_|jj|j|_|jj|j|_|jj|j|_dS(Ntnamessome/filename/some.prototpackagetprotobuf_unittestt
NestedMessagetbbtnumberittypetlabeltForeignEnumtFOREIGN_FOOitFOREIGN_BARitFOREIGN_BAZitResponseMessagetServicet
CallMethodt
input_types .protobuf_unittest.NestedMessagetoutput_types".protobuf_unittest.ResponseMessage(RtFileDescriptorPrototmessage_typetaddtfieldtFieldDescriptorProtot
TYPE_INT32tLABEL_OPTIONALt	enum_typetvaluetservicetmethodtGetDescriptorPooltpooltAddtFindFileByNameRtmy_filetmessage_types_by_namet
my_messagetenum_types_by_nametmy_enumtservices_by_namet
my_servicetmethods_by_namet	my_method(tselft
file_protot
message_protot
enum_protot
service_prototmethod_proto((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pytsetUp>s:			
			cCs
tj�jS(N(RtDefaultR((R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyR'bscCs�|j|jjdd�d�|j|jjdjdj|jjdd��|jt��|jjdd�WdQX|jt��|jjdd�WdQX|jt��|jj�WdQXdS(NRiRi�tNoneEnum(	tassertEqualR-t
EnumValueNameR.tvalues_by_numberRtassertRaisestKeyErrort	TypeError(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestEnumValueNamees	cCs$|j|j|jjdj�dS(Ni(R=R/tvaluesR(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestEnumFixupstscCs=|j|j|jjdj�|j|j|jj�dS(Ni(R=R-tfieldstcontaining_typeR/(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestContainingTypeFixupsws cCs|j|j|jj�dS(N(R=R1R3tcontaining_service(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestContainingServiceFixups{scCs�|j|jj�tj��|j|jjdj�tj��|j|jj�tj��|j|jj	dj�tj
��|j|jj�tj��|j|j
j�tj��dS(Ni(R=R/t
GetOptionsRtEnumOptionsRDtEnumValueOptionsR-tMessageOptionsRFtFieldOptionsR3t
MethodOptionsR1tServiceOptions(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestGetOptions~s




cCsttj}tjj}|jd}|jd}|jd}|jd}|jd}tjj}|jd�}	|j	�}
tj
}|jd|
j|�|j	�}tj
}
|jd|j|
�|j	�}tj}|jd	|j|�tj}|jd
|j|�|j	�}tj}|jd|j|�|j	�}tj}|jd|j|�|j	�}tj}|jd
|j|�|j	�}tj}|jd|j|�|	j	�}tj}|jtj|j|�tjj}|j|j�|j|j�|j|j�|j|j�|j|j�|j|j�|j|j�dS(Ntfield1tAnOneoftAnEnumtANENUM_VAL2tANENUM_VAL1tFool�`	i���l-a�i*i����i��i{l�����`	(Rt
DESCRIPTORtTestMessageWithCustomOptionstfields_by_nametoneofs_by_nameR.tenum_values_by_nametTestServiceWithCustomOptionstFindMethodByNameRKt	file_opt1R=t
Extensionstmessage_opt1t
field_opt1t
field_opt2t
oneof_opt1t	enum_opt1tenum_value_opt1tservice_opt1tmethod_opt1tMETHODOPT1_VAL2tDummyMessageContainingEnumt
assertTruethas_optionstassertFalse(R4tfile_descriptortmessage_descriptortfield_descriptortoneof_descriptortenum_descriptortenum_value_descriptortother_enum_value_descriptortservice_descriptortmethod_descriptortfile_optionsR`tmessage_optionsRbt
field_optionsRcRdt
oneof_optionsRetenum_optionsRftenum_value_optionsRgtservice_optionsRhtmethod_optionsRi((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestSimpleCustomOptions�s\	


									c
Cs�d}d}d}d}d}d}tjj}|j�}|jt|jtj�|j||jtj�|j||jtj	�|jd|jtj
�|jd|jtj�|j||jtj�|j||jtj
�|jd|jtj�|jd|jtj�|j||jtj�|j||jtj�tjj}|j�}|jt|jtj�|j||jtj�|j||jtj	�|j||jtj
�|j||jtj�|j||jtj�|j||jtj
�|j||jtj�|j||jtj�|j||jtj�|j||jtj�tjj}|j�}|jd|jtj�|jd	|jtjd
�|jd|jtj�|jd|jtj�|jd
|jtj�tj}	|j|	j|jtj�tjj}|j�}|jd|jtjd
�|jd|jtj�tjj}|j�}|jd|jtjd
�|jd|jtj�dS(Niii?ii i@ii����g��$��(@ig�Y�B��?sHello, "World"sHelloWorldii�i�if���ll����ll����ll��ll����ll��ll����(RtCustomOptionMinIntegerValuesRYRKR=tFalseRatbool_optt	int32_optt	int64_optt
uint32_optt
uint64_optt
sint32_optt
sint64_opttfixed32_opttfixed64_opttsfixed32_opttsfixed64_opttCustomOptionMaxIntegerValuestTruetCustomOptionOtherValuestassertAlmostEqualt	float_optt
double_optt
string_optt	bytes_optRktTEST_OPTION_ENUM_TYPE2tenum_opttSettingRealsFromPositiveIntstSettingRealsFromNegativeInts(
R4t	kint32mint	kint64mint	kint32maxt	kint64maxt
kuint32maxt
kuint64maxRpRyt
dummy_enum((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestDifferentCustomOptionTypes�s�	cCsYtjj}|j�}|jd|jtjj�|jd|jtjjtj�|jd|jtjjtj	j
�|jd|jtjj�|jd|jtjjtj
�|jd|jtjjj�|jd|jtjjjtj�|jd|jtjjjtj	j
�|jd	|jtjjtjj�|jd
|jtjjtjjtj�|jd|jtjjtjjtj	j
�|jd|jtjjjj�|jd
|jtjjj�|jd|jtjj
�|jd|jtjjj�|jd|jtjj�dS(Ni*iDili�i�i�i�i�i�i�iIi�iAi	ii(RtVariousComplexOptionsRYRKR=Ratcomplex_opt1tfootquuxtcorgetquxtcomplex_opt2tbaztgraulttbartgarplytComplexOptionType2tComplexOptionType4tcomplex_opt4twaldotfredtcomplex_opt3tcomplexoptiontype5tplughtcomplexopt6txyzzy(R4Rtoptions((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestComplexExtensionOptions sX









c	Cs�tj}tjj}|jd}tjj}|jd}tjj}|jd�}|j�j	tj
}|jd|j�|jd|j
�|jd|jj
�|jd|jj	tj
j
�|jd|jj	tjjj
�|jd	|j�j	tjj
�|jd
|j�j	tjj
�|jd|j�j	tjj
�|jd|j�j	tjj
�|jd
|j�j	tjj
�|jd|j�j	tjj
�dS(Nt	fieldnametVALUEtMethodidtFileAnnotationtNestedFileAnnotationtFileExtensionAnnotationtEmbeddedMessageSetElementtMessageAnnotationtFieldAnnotationtEnumAnnotationtEnumValueAnnotationtServiceAnnotationtMethodAnnotation(RRYtAggregateMessageR[t
AggregateEnumtvalues_by_nametAggregateServiceR_RKRatfileoptR=titstsubtfiletmsettAggregateMessageSetElementtmessage_set_extensiontmsgopttfieldopttenumoptt
enumvaloptt
serviceoptt	methodopt(	R4RoRpRqRsRtRvRwRx((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestAggregateOptionsRsP	


cCs�tjjj}|jd|j�jtj�|jd}|jd|j�jtj	�tjj}|j
d}|jd|j�jtj�|jd}|jd|j�jtj
�|jd}|jd	|j�jtj�dS(
Ni�tnested_fieldi�t
NestedEnumi�tNESTED_ENUM_VALUEi�tnested_extensioni�(RtNestedOptionTypeRRYR=RKRaRbR[RcR.RfR]Rgtextensions_by_nameRd(R4tnested_messageR�t
outer_messagetnested_enumtnested_enum_valueR�((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestNestedOptions�s 



cCs6|j|jj|j�|j|jj|j�dS(N(R=R/R�R+R-(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestFileDescriptorReferences�scCs�|j|jjd�|j|jjd�|j|jj|j�|j|jj�|jd|jj�tj	�}|jj
|�|j|jj|j��|jt
jjtj��dS(Nssome/filename/some.protoR
tproto2(R=R+RRR(RnRmtsyntaxRRtCopyToProtot
serialized_pbtSerializeToStringRRYRR;(R4R5((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestFileDescriptor�s
tcppisAImmutability of descriptors is only enforced in v2 implementationcCs}tj}tjj}|jd}|jd}|jd}|jt��d|_WdQX|jt	��d|jd<WdQX|jt	��|j
jd�WdQX|jt��||_WdQX|jt��t
|_WdQX|jt��t
|_WdQX|jt��t
|_WdQX|jt��t
|_WdQX|jt��}t|_WdQX|jdt|j��dS(Ntoptional_int32R�toneof_fieldtAnothers&attribute is not writable: has_options(RRYtTestAllTypesR[R.R\R@tAttributeErrortNoneRBRFtappendRGR�RmR�R=tstrt	exception(R4RoRpRqRsRrte((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestImmutableCppDescriptor�s2	


	(t__name__t
__module__R:R'RCRERHRJRRR�R�R�R�R�R�R�tunittesttskipIfRtTypetVersionR�(((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyR
<s"	$							6	^	2	1			
!tNewDescriptorTestcBseZdZd�ZRS(sARedo the same tests as above, but with a separate DescriptorPool.cCs
tj�S(N(RtDescriptorPool(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyR'�s(R�R�t__doc__R'(((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyR��stGeneratedDescriptorTestcBs_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
s:Tests for the properties of descriptors in generated code.cCs|j|jd�|j|jd�|j||�|j|jdj|�|j||g�|j|id|6�|j|j�|j|j	�|j|j
�|j|j�|j|j�|j|j
�|j|j�|j|jdj�|j|jg�dS(NR�sprotobuf_unittest.TestAllTypesi(R=Rt	full_nameRFRGtassertInR�tCheckDescriptorSequencetCheckDescriptorMappingR[tfields_by_numbertfields_by_camelcase_nameR.R]R\t
enum_typesR�textension_ranges(R4Rp((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pytCheckMessageDescriptor�s"cCs(|j|jd�|j|jd�|j|jd�|j|jjd�|j|jtj�|j||�|j|jjd|�|j|jj	d|�|j
||g�|j
|id|6�|jd|j�|jd|j
�tj�dkr$|j|j|j�ndS(NR�t
optionalInt32s-protobuf_unittest.TestAllTypes.optional_int32R�R�(R=Rtcamelcase_nameRRGR�RRYR[RRR�textension_scopeR#RR�tid(R4Rq((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pytCheckFieldDescriptor�s(
	cCsK|j|tjjj�|j|g�|j|d�|j|dk�|j||�t|�}|j||�|jt	|�d�|jt	|�t	|��|j|t	|�d|d�|d}|j||d�|j
||�|j|j|�d�|j|j|�d�tj
jjd}|j||�|j|j|�d�|jt|j|�|jt|jg�t|�}|jt|�t|�ddd��|jtt|�d|d<|j||�tj�dkr-|jtt|��t|��n|jt|�dd�dS(Niii����schange valuetpythont<(tassertNotEqualRtTestAllExtensionsRYRFRnR=tlistt
assertGreatertlenRtindextcounttNestedTestAllTypestassertNotInR@t
ValueErrortreversedt
StopIterationtnextRR�R�(R4tsequencet
expected_listtitemt
other_itemtreversed_iterator((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyRs:	"
)
%cs�j|tjjj��j|i��j|d��j|dk�t|j��}�j||��j||��j	t
|�d��jt
|�t
|��tjdkr�t
t|j���\}}n|j�d\}}�j||��j|j|�|��jt��|j�WdQXtj�dkrj�jt|jg�n�jd|jg��t
t|j���t
t|j���f}�j|t
t|j����tjdkrA�fd�}||j�|j��||j�|j��||j�|j��nd||<�j||�||=d|d<�j||��jt|jd	��jt|jt
|�d�tj�dkr��jt
tt|j����t
t|���n�jt|�dd
�dS(
NiiiRcs8�jt|�|d��jt|�|d�dS(Nii(R=RR(tseqtiterator(R4(sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt
CheckItemsBsschange valuetnewtnew_keyt	key_errorR(i(i(RRRRYR[RntdicttitemsR=RRtsystversion_infoRtiterRtgetR@RBRR�R�tkeysRDtiterkeyst
itervaluest	iteritemsRAt__getitem__R�(R4tmappingt
excepted_dicttkeyR R%((R4sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyR$sJ!0"

 7cCs�tjj}|j|�|jd}|j|�|jd}|j|�tjjd}|jd|j
�|jtjjjdg�|jtj
jjdd
dg�dS(NR�R
Rii i*i+i/i�i(ii (i*i+(i/i�(ii (RR�RYR	R[RRR.R=R�RGRRtTestMultipleExtensionRanges(R4RpRqRs((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestDescriptorUs 



	
cCsstj}|j|j�|j|j�|j|j�|j|j�|j|j�|jtj	jj�dS(N(
RRYRtdependenciesRR,R.R0R�tTestNestedExtension(R4tcontaining_file((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCppDescriptorContainerhs	cCsBtjjjd}t|j�}~|jdt|�j�dS(NR�tFOO(	RR�RYR.R-RDR=RR(R4tenumtvalues_iter((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt#testCppDescriptorContainer_IteratorrscCsztjjd}|j|jd�|j|jdjd�|j|jtj�|j|jd�|j	|j
�dS(NtTestServiceiRX(RRYR0R=RtmethodstassertIsR�RRR2(R4Rv((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestServiceDescriptoryscCsytjj}|jd}|j|j�|j||j�|jd|j�|jd|j	�|jd|j
�dS(NR�s*protobuf_unittest.TestAllTypes.oneof_fieldi(RR�RYR\RnRmR=RGRRR(R4RpRr((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestOneofDescriptor�s
	
(R�R�R�R	RRRR8R<R@RDRE(((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyR�s			#	1		
		tDescriptorCopyToProtoTestcBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ejej�dkd
�d��Zejej�dkd�d��ZRS(s)Tests for CopyTo functions of Descriptor.cCsF|�}tj||�|j||dt|�t|�f�dS(Ns#Not equal,
Actual:
%s
Expected:
%s
(R	tMergeR=R�(R4tactual_prototexpected_classtexpected_asciitexpected_proto((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt_AssertProtoEqual�s	cCs-|�}|j|�|j|||�dS(N(R�RL(R4tdesctexpected_proto_classtexpected_proto_asciitactual((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt_InternalTestCopyToProto�s	
cCs |jtjjtjt�dS(N(RQRtTestEmptyMessageRYRtDescriptorProtot#TEST_EMPTY_MESSAGE_DESCRIPTOR_ASCII(R4((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_EmptyMessage�s	cCs)d}|jtjjjtj|�dS(Ns�
      name: 'NestedMessage'
      field: <
        name: 'bb'
        number: 1
        label: 1  # Optional
        type: 5  # TYPE_INT32
      >
      (RQRR�RRYRRS(R4tTEST_NESTED_MESSAGE_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_NestedMessage�s
	cCs&d}|jtjjtj|�dS(Ns�
      name: 'TestForeignNested'
      field: <
        name: 'foreign_nested'
        number: 1
        label: 1  # Optional
        type: 11  # TYPE_MESSAGE
        type_name: '.protobuf_unittest.TestAllTypes.NestedMessage'
      >
      (RQRtTestForeignNestedRYRRS(R4tTEST_FOREIGN_NESTED_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt$testCopyToProto_ForeignNestedMessage�s

	cCs&d}|jtjjtj|�dS(Ns�
      name: 'ForeignEnum'
      value: <
        name: 'FOREIGN_FOO'
        number: 4
      >
      value: <
        name: 'FOREIGN_BAR'
        number: 5
      >
      value: <
        name: 'FOREIGN_BAZ'
        number: 6
      >
      (RQRRRYRtEnumDescriptorProto(R4tTEST_FOREIGN_ENUM_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_ForeignEnum�s
	cCs&d}|jtjjtj|�dS(Ns�
      name: 'TestDeprecatedFields'
      field: <
        name: 'deprecated_int32'
        number: 1
        label: 1  # Optional
        type: 5  # TYPE_INT32
        options: <
          deprecated: true
        >
      >
      (RQRtTestDeprecatedFieldsRYRRS(R4tTEST_DEPRECATED_FIELDS_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_Options�s
	cCs&d}|jtjjtj|�dS(Ns}
      name: 'TestEmptyMessageWithExtensions'
      extension_range: <
        start: 1
        end: 536870912
      >
      (RQRtTestEmptyMessageWithExtensionsRYRRS(R4t(TEST_EMPTY_MESSAGE_WITH_EXTENSIONS_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_AllExtensions�s
	cCs&d}|jtjjtj|�dS(Ns
      name: 'TestMultipleExtensionRanges'
      extension_range: <
        start: 42
        end: 43
      >
      extension_range: <
        start: 4143
        end: 4244
      >
      extension_range: <
        start: 65536
        end: 536870912
      >
      (RQRR7RYRRS(R4t*TEST_MESSAGE_WITH_SEVERAL_EXTENSIONS_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt!testCopyToProto_SeveralExtensions�s
	cCs+ddd}|jtjtj|�dS(Nsd
      name: 'google/protobuf/unittest_import.proto'
      package: 'protobuf_unittest_import'
      dependency: 'google/protobuf/unittest_import_public.proto'
      message_type: <
        name: 'ImportMessage'
        field: <
          name: 'd'
          number: 1
          label: 1  # Optional
          type: 5  # TYPE_INT32
        >
      >
      s�enum_type: <
        name: 'ImportEnum'
        value: <
          name: 'IMPORT_FOO'
          number: 7
        >
        value: <
          name: 'IMPORT_BAR'
          number: 8
        >
        value: <
          name: 'IMPORT_BAZ'
          number: 9
        >
      >
      enum_type: <
        name: 'ImportEnumForMap'
        value: <
          name: 'UNKNOWN'
          number: 0
        >
        value: <
          name: 'FOO'
          number: 1
        >
        value: <
          name: 'BAR'
          number: 2
        >
      >
      options: <
        java_package: 'com.google.protobuf.test'
        optimize_for: 1  # SPEED
      sG
        cc_enable_arenas: true
      >
      public_dependency: 0
    (RQRRYRR(R4t%UNITTEST_IMPORT_FILE_DESCRIPTOR_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_FileDescriptors0cCs&d}|jtjjtj|�dS(NsM
      name: 'TestService'
      method: <
        name: 'Foo'
        input_type: '.protobuf_unittest.FooRequest'
        output_type: '.protobuf_unittest.FooResponse'
      >
      method: <
        name: 'Bar'
        input_type: '.protobuf_unittest.BarRequest'
        output_type: '.protobuf_unittest.BarResponse'
      >
      (RQRRARYRtServiceDescriptorProto(R4tTEST_SERVICE_ASCII((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt!testCopyToProto_ServiceDescriptorNs

	Rs It is not implemented in python.cCs5d}tjjjd�}|j|tj|�dS(Ns}
      name: 'Foo'
      input_type: '.protobuf_unittest.FooRequest'
      output_type: '.protobuf_unittest.FooResponse'
    RX(RRARYR_RQRtMethodDescriptorProto(R4RJRw((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt testCopyToProto_MethodDescriptoras		s!Pure python does not raise error.cCs�tj�}|jttjjj|�|jttjjj|�|jttj	jj|�tj
�}|jttjj|�dS(N(RRR@RBRRRRYR�RRARSR(R4R5tproto((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCopyToProto_TypeErrorrs					(R�R�R�RLRQRURWRZR]R`RcReRgRjR�R�RR�RlRn(((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyRF�s$											;	tMakeDescriptorTestcBs5eZd�Zd�Zd�Zd�Zd�ZRS(c	Csrtj�}d|_|jj�}|j|_|jj�}d|_|jj�}d|_|jj�}d|_d|_|j	j�}d|_d|_t
jj|_
t
jj|_|j	j�}d|_d	|_t
jj|_
t
jj|_d|_|j	j�}d|_d
|_t
jj|_
t
jj|_d|_t
j|�}|j|jdjt
jj�|j|jdjt
jj�|j|jdjj|�|j|jdjdjd
�|j|jdjdj|jdjd�|j|j�|j|jdj�tj �dkrn|j!t"��t#|jd_WdQXndS(NtFoo2tSubR=tBARiituint64_fielditnested_message_fieldt	bar_fieldsFoo2.Sub.FOOisFoo2.Sub.bar_fieldR�($RRRRRtnested_typeR#R$RRRtFieldDescriptortLABEL_REQUIREDRtTYPE_UINT64RtTYPE_MESSAGEt	type_namet	TYPE_ENUMtMakeDescriptorR=RFtcpp_typetCPPTYPE_UINT64tCPPTYPE_MESSAGERGtnested_typesRRRnRmRR�R@R�R�(	R4tfile_descriptor_protoRRvR#t
enum_type_valRt
enum_fieldtresult((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt"testMakeDescriptorWithNestedFields�sX													

cCs#tj�}d|_|jj�}|j|_|jj�}d|_|jj�}d|_d|_|jj�}d|_d|_t	j
j|_t	j
j
|_|jj�}d|_d|_t	j
j|_t	j
j|_d	|_t	j|�}|j|jd
jt	j
j�dS(NRXR=RriiRsiRusFoo.FOOi(RRRRRR#R$RRRRwRxRRyRR|R{R}R=RFR~R(R4R�RR#R�RR�R�((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt&testMakeDescriptorWithUnsignedIntField�s.									cCsatj�}tj}|jj|�tj|�}|j�}|j	d|j
tjj�dS(Nie(
RRSRR�RYR�RR}RKR=RaR�R�(R4tdescriptor_prototaggregate_messagetreformed_descriptorR�((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestMakeDescriptorWithOptions�s		cCs�tj�}d|_dddddg}dddddg}xCtt|��D]/}|jj�}|d|_|||_qRWtj	|�}x8tt|��D]$}|j
|j|j||�q�WdS(	NtBartfoo_footFooBartfooBaztfooFootfoobartfooBari(
RRSRtrangeRRRRRR}R=RFR(R4R�tnamestcamelcase_namesRRR�((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestCamelcaseName�s	
cCs�tj�}d|_ddddddg}dddddd	g}xCtt|��D]/}|jj�}|d
|_|||_qXWd	|_t	j
|�}x8tt|��D]$}|j|j|j||�q�WdS(NtTestJsonNamet
field_namet	fieldNamet	FieldNamet_field_namet
FIELD_NAMEt	json_namet	FIELDNAMEs@typei(
RRSRR�RRRRR�RR}R=RF(R4R�R�t
json_namesRRR�((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyttestJsonName�s			
	(R�R�R�R�R�R�R�(((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyRo�s
	/		
	t__main__(R�t
__author__R+t	unittest2R�tImportErrortgoogle.protobufRRRRtgoogle.protobuf.internalRRRRRR	RTtTestCaseR
R�RRFRoR�tmain(((sL/usr/lib/python2.7/site-packages/google/protobuf/internal/descriptor_test.pyt<module> s2
����v