%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_struct.pyc


Nac
@sOddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlZejdkZ
ejdkZdddd	d
ddd
ddf
ZejjeddZyejddWnejk
reZnXeZdZdZdejfdYZdZedkrKendS(iN(ttest_support(tcheck_warningstcheck_py3k_warningstbigitbtBthtHtitItltLtqtQis.pyicCsdjt|S(Nt(tjointreversed(ts((s,/usr/local/lib/python2.7/test/test_struct.pytstring_reversescCstr
|St|SdS(N(tISBIGENDIANR(tvalue((s,/usr/local/lib/python2.7/test/test_struct.pytbigendian_to_nativest
StructTestcBseZdZdZdZdZdZdZdZdZ	dZ
d	Zed
Z
eedZdZd
ZdZdZdZdZejeddZdZdZejdZdZRS(cCstdtf}tj||}WdQXtjjd}|j|jt	|j|j
||jt|jdtj|t
|}|j||dS(Ns&.*integer argument expected, got floati(RtDeprecationWarningtstructtpacktinspecttcurrentframetf_linenotassertEqualtfilenamettestmod_filenametlinenotlentwarningstint(tselftformattnumbertwtgotR texpected((s,/usr/local/lib/python2.7/test/test_struct.pytcheck_float_coerce$scCs0|jtjdddtdktdS(Ns=iii(RRRtchrR(R$((s,/usr/local/lib/python2.7/test/test_struct.pyttest_isbigendian1scCsr|jtjtjdtjd}|j|dtjdd}d}tj|}tj|}|j|d||jtjtjdd|jtjtjdddd|jttjftjdd|jttjftjdd|jtjtjd	d
tjddd
}|jtjtjd||jtjtjd|dS(NtZRitiiiscbxxxxxxhhhhiillffd?s3c3b18x12h6i6l6f3d3?tfootPtdtflaptiiii(tassertRaisesRterrortcalcsizeRRt	TypeErrortunpack(R$tsztfmttfmt3tsz3R((s,/usr/local/lib/python2.7/test/test_struct.pyttest_consistence4s """cCsYd}d}d}d}d}d}d}t}x"dD]}	xdD]	}
|	|
}
tj|
||||||||	}tj|
|\}}
}}}}}}|j|||j|
||j|||j|||j|||jtd|td||jtd|td||j||qDWq7WdS(Ntaiiiigo!	@Rt@t<t>t=t!s	xcbhilfd?s	xcBHILfd?id(RR?R@RARBRC(s	xcbhilfd?s	xcBHILfd?(tTrueRRR8RR#(R$tcRRRR
tfR1tttprefixR%Rtcptbpthptiptlptfptdpttp((s,/usr/local/lib/python2.7/test/test_struct.pyttest_transitivenessIs*


'*$$c'CsdEdFdGdHdIdJdKdLdMdd
d
dNd
dOdfdPdQdRdSdTdUdVd$dWd"d#dfdXdYdZd-d[d+d,dfd\d]d^d1d_d+d,dfd`dadbdcddded>td@d@dfd>gdddfd>dfd@d@dfg#}x|D]\}}}}}xdA||fdB||fdC||fdD|tr9|p<|fgD]\}}tj||}	|j|	||jtj|t|	tj||	d}
|
|krC|j|qCqCWqWdS(gNRER>itxcsatcxsaRt0st
helloworldRit1sRt9st	helloworlt10st11sshelloworldt20si
sRisisRiissiDsDsDRiRi,s,s,issR	lXlR
RRFg@s@s@R1s@s@gsssst?isRARCR@RB(RER>R>R>i(RRR>sasai(RSR>sasai(RR>R>R>i(RTRURRi(RVRURRi(RWRURXRXi(RYRURURUi(RZRUshelloworldshelloworldis
s
(Rissi(Rissi(Rissi(Rissi(Rissi(RiDsDsDi(RissiiD(Ri,s,s,i(Rissi(R	lXs,s,ilbw(R
i,s,s,i(R
issi(RlXs,s,ilbw(RFg@s@s@i(R1g@s@s@i(RFgssi(R1gssi(R\issi(R\issi(i(	RDRRRRR6R!R8t
assertTrue(R$ttestsR:targRtliltasytxfmttexptrestrev((s,/usr/local/lib/python2.7/test/test_struct.pyttest_new_featuresas\*)c	Csi
dd6dd6dd6dd6dd6dd	6dd
6dd6dd
6dd6}xLtD]D}x;dD]3}||}tj|}|j|||q`WqSWxcdD][}xRddgD]D}tj||d}tj||d}|j||qWqW|jtjdd|jdtjd|jdtjd
|jtjdtjd|jtjdtjd
tr|jtjd
tjd|jdtjd
|jtjd
tjd
ndS(NiRRiRRiRR	R
RiRR
RBR@RARCtbBthHtiItlLRR?i(RBR@RARC(RgRhRiRj(t
integer_codesRR6RtassertLessEqualtHAVE_LONG_LONG(	R$t
expected_sizetcodet	byteorderR%tsizetformat_pairtsigned_sizet
unsigned_size((s,/usr/local/lib/python2.7/test/test_struct.pyt
test_calcsizes2



"""csddldtjffdYd}xdtD]\}xS|D]K}|d
krv|dkrvtrvqKn||}|jqKWq>WdS(Nit	IntTestercsAeZfdZejejjdZfdZRS(cs&t|jdd||_|d|_|d |_|jdkratd
|jntj||_|jd|_	|jt
dkrt|_d
|j	d|_
d
|j	dd|_nQ|jt
dkrt|_d|_
d
|j	d|_ntd|jdS(Nt
methodNamettest_oneiRR?RBR@RARCs"unrecognized packing direction: %sitbhilqlitBHILQisunrecognized format code: %s(RR?RBR@RARC(tsupert__init__R%Rot	directiont
ValueErrorRR6tbytesizetbitsizettupleRDtsignedt	min_valuet	max_valuetFalse(R$R%(Rv(s,/usr/local/lib/python2.7/test/test_struct.pyR|s&	

			c	Ss|j}|j|ko&|jknrst|}|jr`|dkr`|d|j>7}n|j|dd|}t|d@rd|}n||}d|jt||}|j	dks|j	dkrt
rt|}n|jt||j|||}|j|||||d}|j|||j
tjtf||d|n"|j
tttjf|||dS(
Nils%xit0sR@RR?RBs(RR?RB(R%RRtlongRRtassertGreaterEqualR!RR}RRRR4RR5R7t
OverflowErrorR~(	R$txRR8t	unhexlifyR%R)R(t	retrieved((s,/usr/local/lib/python2.7/test/test_struct.pyRxs0	"

csddlm}g}x,t|jdD]}|jd|>q*WxXt|jD]G}d}x+t|jD]}|d>|dB}qqW|j|qUW|jdd	tjd
gxg|D]_}xV||fD]G}x>d"D]6}||}	|j	t
|	|j	t|	qWqWqWd
tfdY}
dd#dY}dtfdY}dtfdY}
|j
ttjftj|jd|j
ttjftj|j|tdtf7|j
ttjftj|jd$WdQXWdQXx|
||
fD]}tdtf}tj|j|}WdQXtjjd}|j|jt|j|j||jt|jdtj|jt
|}|j||q*Wxo|d|d|d|d|d|dfD]1}ytj|Wq|jdqXqWxp|d|d |d|idd6|dd!dgfD]+}|j
ttjftj|j|qWdS(%Ni(t	randrangeilliii,i`
iiit
NotAnIntNScBseZdZdZRS(cSsdS(Ni*((R$((s,/usr/local/lib/python2.7/test/test_struct.pyt__int__scSsdS(Nl((R$((s,/usr/local/lib/python2.7/test/test_struct.pyt__long__s(t__name__t
__module__RR(((s,/usr/local/lib/python2.7/test/test_struct.pyRs	t
NotAnIntOScBseZdZdZRS(cSsdS(NiU((R$((s,/usr/local/lib/python2.7/test/test_struct.pyR scSsdS(Nl((R$((s,/usr/local/lib/python2.7/test/test_struct.pyR#s(RRRR(((s,/usr/local/lib/python2.7/test/test_struct.pyRs	t	IndexablecBseZdZdZRS(cSs
||_dS(N(t_value(R$R((s,/usr/local/lib/python2.7/test/test_struct.pyR|*scSs|jS(N(R(R$((s,/usr/local/lib/python2.7/test/test_struct.pyt	__index__-s(RRR|R(((s,/usr/local/lib/python2.7/test/test_struct.pyR)s	tBadIndexcBseZdZdZRS(cSs
tdS(N(R7(R$((s,/usr/local/lib/python2.7/test/test_struct.pyR3scSsdS(Ni*((R$((s,/usr/local/lib/python2.7/test/test_struct.pyR6s(RRRR(((s,/usr/local/lib/python2.7/test/test_struct.pyR2s	sa strings*integer argument expected, got non-integeryE@s,.*integer argument expected, got non-integeri
ii*idis:integer code pack failed on object with '__index__' methodR>ubi(iii(y@E@( trandomRtrangeRtappendRtextendtsystmaxintRxR#RtobjectR4R7RR5RR%RRRRRRRRR R!R"tfailtNone(R$RtvaluesRcRtvaltjtbasetincrRRRRRtnonintR'R(R R)tobj(R%(s,/usr/local/lib/python2.7/test/test_struct.pytrunsf



	
%,(	RRR|RRR8RRxR((RvtbinasciiR%(s,/usr/local/lib/python2.7/test/test_struct.pyRvs
#RR?RBR@RARCRR
(RR?RBR@RARC(RR?(RR
(RtunittesttTestCaseRkRmR(R$t
byteordersRoRpRG((RvRR%s,/usr/local/lib/python2.7/test/test_struct.pyt
test_integerss%


cCsxdddddddddddddddfgD]Y\}}}}tj||}|j||tj||\}|j||q;WdS(NtptabcsRt1pt2psaR>t3psabtabt4psabct5psabct6psabct1000pRisii(RRsR(RRsR(RRsaR>(RRsabR(RRsabcR(RRsabcR(RRsabcR(RRRR8(R$RotinputR)texpectedbackR(((s,/usr/local/lib/python2.7/test/test_struct.pyttest_p_codels5c	Csfddl}xtddD]}d}x"||d|krL|d:}q+W||}tjd|}tjd|d}|j||tjd|}|j|t|tjd|d}|j||qWd}|j|d}tjd|}tjd|d}|j||d}|j|d}|jt	tjd|dS(Niii!g?g@s<fis>fiiiiiiihiiig(
tmathRRRR8RRtldexpR4R(	R$RRtdeltatsmallertpackedtunpackedt	bigpackedR((s,/usr/local/lib/python2.7/test/test_struct.pyttest_705836|s*
cCsNxGdD]?}x6tD].}|j||d|j||dqWqWdS(NRRAR@g?g?(RRAR@(RkR*(R$tendianR:((s,/usr/local/lib/python2.7/test/test_struct.pyttest_1530559s

cCs'|d}d}tj|}|j|j|d|jtj||dxktdD]]}|j|j|||||d!f|jtj||||||d!fqcWx\tdt|dD]A}|jtj|j|||jtjtj|||qWdS(	Nt	abcd01234t4stabcdiii(R(R(RtStructRtunpack_fromtxrangeR!R4R5(R$tclstdataR:RR((s,/usr/local/lib/python2.7/test/test_struct.pyttest_unpack_froms*1 c
Cs.d}|dd}d}tj|}|j|d|||t| }|j|||j|d|||t|d }|j||d ||d	}|jttjf|j|d||jttjf|j|d||}	|jttjftjd|	ddS(
NsReykjavik rocks, eow!t idt21sii
iRs
          (
RRt	pack_intoR!RR4R~R5R7R(
R$Rttobytesttest_stringtwritable_bufR:Rtfrom_buft	small_buftsb((s,/usr/local/lib/python2.7/test/test_struct.pyttest_pack_intos$cCs#|jdddtjjdS(NRcSstjd|S(NRE(tarray(R((s,/usr/local/lib/python2.7/test/test_struct.pyt<lambda>RR(RRttostring(R$((s,/usr/local/lib/python2.7/test/test_struct.pyttest_pack_into_arrayscCs |jdddtjdS(NRcSstt|S(N(t
memoryviewt	bytearray(R((s,/usr/local/lib/python2.7/test/test_struct.pyRRR(RRR(R$((s,/usr/local/lib/python2.7/test/test_struct.pyttest_pack_into_memoryviewscsd}tjddd}dfd}||d||jt| }|j||||d||jt|d }|j||d |tjdd
}|jttjf||d||jttjf||d	|dS(NsReykjavik rocks, eow!RERidRcstj|S(N(RR(targs(R:(s,/usr/local/lib/python2.7/test/test_struct.pyRRii
is
          (RRR!RR4R~RR5(R$RRRRR((R:s,/usr/local/lib/python2.7/test/test_struct.pyttest_pack_into_fnscCstdtfutjdd}tddd}x9||gD]+}tjd|\}|j|dqDW|jd	tWdQXdS(
Nsbuffer.. not supported in 3.xRs4Vxs......4Vx......iis>IixV4R(RRRtbufferRR8RR(R$tdata1tdata2RR((s,/usr/local/lib/python2.7/test/test_struct.pyttest_unpack_with_buffers
cCsYtd}x6|gD]+}tjd|\}|j|dqW|jdtdS(Ns4Vxs>IixV4R(RRR8RR(R$RRR((s,/usr/local/lib/python2.7/test/test_struct.pyttest_unpack_with_memoryviews
cCsdtfdY}xtddD]}dggddf}dgddd	ddf}|d
t|}tj||}tj||}|d
t|}tj||}	tj||	}
|jt|t|
|jt|t|x|D]}|j|qWx|
D]}|j|q*Wtj|d
d}|jt|tj	|d
t|dkr|j|dd|n|j
ttj|d
|q'Wx:dddddgD]#}
|jtjd|
dqWdS(Nt
ExplodingBoolcBseZdZRS(cSs
tdS(N(tIOError(R$((s,/usr/local/lib/python2.7/test/test_struct.pyt__nonzero__s(RRR(((s,/usr/local/lib/python2.7/test/test_struct.pyRss<>!=RiittestiilIiR\tmsgs encoded bool is not one byte: %rssssss>?(R(li(RRR!RRR8RtassertFalseR]R6R4R(R$RRHtfalsettruetfalseFormattpackedFalset
unpackedFalset
trueFormatt
packedTruetunpackedTrueRGRRE((s,/usr/local/lib/python2.7/test/test_struct.pyt	test_bools2

#sSpecific to 32bit machinescCs|jttjdddS(Nt
357913941cR>(R4tMemoryErrorRR(R$((s,/usr/local/lib/python2.7/test/test_struct.pyttest_crasher*scCsldjtjd}|jtjtj|djtjdtjd}|jtjtj|dS(Ns{}bis{}b{}Hi(R%RtmaxsizeR4RR5R6(R$t	hugecountt
hugecount2((s,/usr/local/lib/python2.7/test/test_struct.pyttest_count_overflow.s cCsJtjd}|tjd|d7}tj|tj||dS(Nt5Pt3Pi(tsupporttcalcobjsizeRR6tcheck_sizeofR(R$t
format_strtnumber_of_codest	totalsize((s,/usr/local/lib/python2.7/test/test_struct.pyR5scCsxtD]}|j|dqW|jdd|jddd|jdd|jdd	|jd
d|jdd|jd
d|jdd|jdd	dS(Nit	BHILfdspPi	Ritfditxxxxxxxxxxxxxxit100Hidt187st20pRTt0c(RkR(R$Ro((s,/usr/local/lib/python2.7/test/test_struct.pyttest__sizeof__<s
cCsytWntk
r(|jdnXtjttd}|j|jd|j	t
|jt|jt
tjtddS(Nsno unicode supportR	i(tunicodet	NameErrortskipTestRRtunichrtordRR%tassertIsttypetstrR4R~(R$R((s,/usr/local/lib/python2.7/test/test_struct.pyttest_unicode_formatJs
( RRR*R,R=RQRfRuRRRRRRRRRRRRRRRt
skipUnlesstIS32BITRRRRtcpython_onlyRR(((s,/usr/local/lib/python2.7/test/test_struct.pyR"s.	
				5	$			#							&		cCstjtdS(N(Rtrun_unittestR(((s,/usr/local/lib/python2.7/test/test_struct.pyt	test_mainVst__main__( tosRRRRRRRttest.test_supportRRRRpRRRRktpathtsplitextt__file__RRR5RRmRDRRRRRR(((s,/usr/local/lib/python2.7/test/test_struct.pyt<module>s0$
		6	

Zerion Mini Shell 1.0