Your IP : 18.223.159.237


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

�
Du�ac@s�dZdZyddlZWnek
r;ddlZnXddlmZddlmZdej	fd��YZ
edkr�ej�ndS(	s.Test for google.protobuf.internal.wire_format.s#robinson@google.com (Will Robinson)i����N(tmessage(twire_formattWireFormatTestcBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsod}d}|j|d>|Btj||��tj}|jtj||d�|jtj||d�dS(Ni�
iiii����(tassertEqualRtPackTagtassertRaisesRtEncodeError(tselftfield_numberttag_typeR((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyttestPackTag/s	cCs�xfd	D]^}xUtd�D]G}tjtj||��\}}|j||�|j||�qWqW|jttjd�|jttjd�|jttjd�|jttjt��dS(
Niiii�iitabcg(iiii�i(	trangeRt	UnpackTagRRRt	TypeErrortNonetobject(Rtexpected_field_numbertexpected_wire_typeRt	wire_type((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt
testUnpackTag:s
cCs"tj}|jd|d��|jd|d��|jd|d��|jd|d��|jd|d��|jd|d	��|jd
|d��|jd|d
��|jd|d��|jt|d�|jt|d�|jt|d�|jt|t��dS(Niii����iii����il��i���l��i�l����l����l����l����tabcdg(RtZigZagEncodeRRRRR(RtZ((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyttestZigZagEncodeHs	cCs"tj}|jd|d��|jd|d��|jd|d��|jd|d��|jd|d��|jd|d	��|jd
|d��|jd|d
��|jd|d��|jt|d�|jt|d�|jt|d�|jt|t��dS(Nii����iii����iii���l��i�l��l����l����l����l����Rg(RtZigZagDecodeRRRRR(RR((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyttestZigZagDecodeYs	c
Csfx_d	d
ddfD]K\}}||}|||�}|j||d|||||f�qWdS(
Niiiii�iisFbyte_size_fn: %s, field_number: %d, value: %r
Expected: %d, Actual: %d(ii(ii(i�i(ii(R(Rtbyte_size_fntvaluetexpected_value_sizeRt	tag_bytest
expected_sizetactual_size((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pytNumericByteSizeTestHelperjs
c6CsTtjddgtjddgtjddgtjddgtjddgtjddgtjddgtjddgtjddgtjddgtjddgtjtjdgtjddgtjddgtjddgtjtjdgtjddgtjddgtjddgtjd	dgtjd
dgtjddgtjddgtjddgtjddgtjddgtjd	dgtjd
dgtjddgtjddgtj	dd
gtj	tjd
gtj
ddgtj
tjdgtjdd
gtjtjd
gtjtj
d
gtjddgtjtjdgtjtjdgtjdd
gtjdd
gtjdd
gtjddgtjddgtjddgtjtdgtjtdgtjddgtjddgtjddgtjtjdgg4}x|D]}|j|�q4WxitjtjfD]U}|jd|dd��|jd|dd��|jd|ddd��q^W|jdtjddjd���dtfd��Y}d}|d|�}|jd|tjd|��|jd
|tjd|��|jd|jtjd|��|jd|jtjd|��d|_|jd
|jtjd|��d|_|j|jdtj d|��d|_|j|jdtj d|��|j|jdtj d|��|j!t"j#tjdd�dS(Niiii�ii����i
ii����i?i����i@iigge��Age��Riii�tasТестsutf-8tMockMessagecBseZd�Zd�ZRS(cSs
||_dS(N(t	byte_size(RR$((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt__init__�scSs|jS(N(R$(R((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pytByteSize�s(t__name__t
__module__R%R&(((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyR#�s	R$iil	($Rt
Int32ByteSizet
Int64ByteSizetUInt32ByteSizet
UINT32_MAXtUInt64ByteSizet
UINT64_MAXtSInt32ByteSizetSInt64ByteSizetFixed32ByteSizetFixed64ByteSizetSFixed32ByteSizet	INT32_MINt	INT32_MAXtSFixed64ByteSizet	INT64_MINt	INT64_MAXt
FloatByteSizetDoubleByteSizetBoolByteSizetFalsetTruetEnumByteSizeR!tStringByteSizet
BytesByteSizeRtdecodeRt
GroupByteSizeR$tMessageByteSizetMessageSetItemByteSizeRRR(RtNUMERIC_ARGStargsRR#tmessage_byte_sizetmock_message((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyttestByteSizeFunctionsts�
!

			(R'R(R
RRRR!RI(((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyR-s					
t__main__(
t__doc__t
__author__t	unittest2tunittesttImportErrortgoogle.protobufRtgoogle.protobuf.internalRtTestCaseRR'tmain(((sM/usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt<module> s
�

?>