%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_heapq.pyo

ó
Nêáac@sldZddlZddlZddlmZddlmZmZejdddgƒZ	ejdddgƒZ
d	d
ddd
ddgZdefd„ƒYZdefd„ƒYZ
de
fd„ƒYZee
dƒde
fd„ƒYƒZdd;d„ƒYZdd<d„ƒYZdd=d„ƒYZd„Zd d>d!„ƒYZd"d?d#„ƒYZd$d@d%„ƒYZd&dAd'„ƒYZd(dBd)„ƒYZd*dCd+„ƒYZd,dDd-„ƒYZdd.lmZmZd/„Zd0dEd1„ƒYZd2efd3„ƒYZ d4e fd5„ƒYZ!ee
dƒd6e fd7„ƒYƒZ"dd8„Z$e%d9krhe$d:e&ƒndS(FsUnittests for heapq.iÿÿÿÿN(ttest_support(tTestCaset
skipUnlesstheapqtblockedt_heapqtfreshtheapifytheappoptheappushtheappushpoptheapreplacet	_nlargestt
_nsmallesttTestModulescBs)eZd„Zeedƒd„ƒZRS(cCs1x*tD]"}|jtt|ƒjdƒqWdS(NR(t
func_namestassertEqualtgetattrtpy_heapqt
__module__(tselftfname((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_py_functionss
srequires _heapqcCs1x*tD]"}|jtt|ƒjdƒqWdS(NR(RRRtc_heapqR(RR((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_c_functionss
(t__name__RRRRR(((s+/usr/local/lib/python2.7/test/test_heapq.pyRs	tTestHeapcBs•eZdZd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„ZRS(cCs@g}g}|j|ƒxMtdƒD]?}tjƒ}|j|ƒ|jj||ƒ|j|ƒq&Wg}x6|r§|jj|ƒ}|j|ƒ|j|ƒqrW|}|jƒ|j||ƒ|j|ƒ|j	t
|jjgƒy9|j	t
|jjddƒ|j	t
|jjdƒWntk
r;nXdS(Ni(
tcheck_invarianttrangetrandomtappendtmoduleR	RtsortRtassertRaisest	TypeErrortNonetAttributeError(Rtheaptdatatititemtresultstdata_sorted((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_push_pops.

	



cCsOxHt|ƒD]:\}}|r
|dd?}|j|||kƒq
q
WdS(Ni(t	enumeratet
assertTrue(RR%tposR(t	parentpos((s+/usr/local/lib/python2.7/test/test_heapq.pyR;scCsvxVtdƒD]H}gt|ƒD]}tjƒ^q }|jj|ƒ|j|ƒq
W|jt|jjdƒdS(Ni(RRRRRR!R"R#(RtsizetdummyR%((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_heapifyBs
%cCsŸgtdƒD]}tjdƒ^q
}g}xF|D]>}|jj||ƒt|ƒdkr5|jj|ƒq5q5W|jƒ|j|t	|ƒdƒdS(NièiÐi
iöÿÿÿ(
RRt	randrangeRR	tlenRR Rtsorted(RR'R&R%R(((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_naive_nbestJs(

ccs4yx|jj|ƒVqWWntk
r/nXdS(N(RRt
IndexError(RR%((s+/usr/local/lib/python2.7/test/test_heapq.pytheapiterTs

cCsûgtdƒD]}tjdƒ^q
}|d }|jj|ƒx8|dD],}||dkrM|jj||ƒqMqMW|jt|j|ƒƒt	|ƒdƒ|j
t|jjdƒ|j
t|jjddƒ|j
t
|jjgdƒdS(NièiÐi
iiöÿÿÿ(RRR3RRRRtlistR8R5R!R"R#R7(RR'R&R%R(((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_nbest\s(
)cCs¶gtdƒD]}tjdƒ^q
}|d }|jj|ƒx%|dD]}|jj||ƒqMW|jt|j|ƒƒt	|ƒdƒ|j|jjgdƒdƒdS(NièiÐi
iöÿÿÿtx(
RRR3RRR
RR9R8R5(RR'R&R%R(((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_nbest_with_pushpopns(
)cCs"g}|jj|dƒ}|j||fgdfƒdg}|jj|dƒ}|j||fdgdfƒ|jt|dƒtƒ|jt|ƒtƒdg}|jj|dƒ}|j||fdgdfƒdg}|jj|dƒ}|j||fdgdfƒdS(Ni
g$@ii	i(RR
Rttypetinttfloat(RthR;((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_heappushpopws			cCsáxÚtdƒD]Ì}tjdƒ}gt|ƒD]}tjdƒ^q/}|d@rn|}|jj|ƒn*g}x!|D]}|jj||ƒq{Wgt|ƒD]}|jj|ƒ^q¥}|j|t	|ƒƒq
WdS(Nidi2ii(
txrangeRR3RRRR	RRR5(RttrialR0R'R&R%R(theap_sorted((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_heapsortŠs(

+cCs©g}xOttjdƒƒD]8}td„ttjdƒƒDƒƒ}|j|ƒqW|jtt|Œƒt|j	j
|Œƒƒ|jt|j	j
ƒƒgƒdS(Nicss|]}tjdƒVqdS(ièN(RR3(t.0tj((s+/usr/local/lib/python2.7/test/test_heapq.pys	<genexpr>œsi
(RBRR3R5RRRtchainR9Rtmerge(RtinputsR'trow((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_merge™s%.cCsBd„}|jtƒ$t|jj|ƒ|ƒƒƒWdQXdS(Ncss6ttdƒƒ}xtdƒD]}||VqWdS(Ni
i(R9R(tsR'((s+/usr/local/lib/python2.7/test/test_heapq.pytiterable£s(R!R7R9RRI(RRN((s+/usr/local/lib/python2.7/test/test_heapq.pyt(test_merge_does_not_suppress_index_error¡s	cCsædtfd„ƒY}ggggg}x^tdƒD]P}tjdƒ}tjdƒ}||ƒ}||f|_||j|ƒq5Wx|D]}|jƒqWg|jj|ŒD]}|j^q·}|j	|t
|ƒƒdS(NtIntcBseZRS((RR(((s+/usr/local/lib/python2.7/test/test_heapq.pyRP«si Niiô(R>RRR3tpairRR RRIRR5(RRPRJR'tstreamR;tobjtresult((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_merge_stabilityªs
(c
Cs»gtdƒD]}tjdƒ|f^q
}x†dd„fD]u}xld
D]d}|j|jj||ƒt|ƒ| ƒ|j|jj||d|ƒt|d|ƒ| ƒqKWq>WdS(NièiÐcSs|dddS(Nii#iÐ((R;((s+/usr/local/lib/python2.7/test/test_heapq.pyt<lambda>»tiiii
idiiçiLtkey(	iiii
idiiçièiL(RRR3R#RRt	nsmallestR5(RR'R&tftn((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_nsmallest¹s.
)c
CsÇgtdƒD]}tjdƒ|f^q
}x’dd„fD]}xxdD]p}|j|jj||ƒt|dtƒ| ƒ|j|jj||d
|ƒt|d
|dtƒ| ƒqKWq>WdS(NièiÐcSs|dddS(Nii#iÐ((R;((s+/usr/local/lib/python2.7/test/test_heapq.pyRVÃRWiiii
idiiçiLtreverseRX(	iiii
idiiçièiL(	RRR3R#RRtnlargestR5tTrue(RR'R&RZR[((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_nlargestÁs.
cs¢‡fd†}ddd„ƒY}dd	d„ƒY}gtdƒD]}tjƒ^qB}t|dtƒ}ˆj|||ƒ|ƒˆj|||ƒ|ƒdS(
NcsQt||ƒ}ˆjj|ƒgtt|ƒƒD]}ˆjj|ƒj^q2S(N(tmapRRRR4RR;(R&tcompR'(R(s+/usr/local/lib/python2.7/test/test_heapq.pythsortÌstLTcBseZd„Zd„ZRS(cSs
||_dS(N(R;(RR;((s+/usr/local/lib/python2.7/test/test_heapq.pyt__init__ÑscSs|j|jkS(N(R;(Rtother((s+/usr/local/lib/python2.7/test/test_heapq.pyt__lt__Ós(RRReRg(((s+/usr/local/lib/python2.7/test/test_heapq.pyRdÐs	tLEcBseZd„Zd„ZRS(cSs
||_dS(N(R;(RR;((s+/usr/local/lib/python2.7/test/test_heapq.pyReÖscSs|j|jkS(N(R;(RRf((s+/usr/local/lib/python2.7/test/test_heapq.pyt__le__Øs(RRReRi(((s+/usr/local/lib/python2.7/test/test_heapq.pyRhÕs	idR](((RRR5R_R(RRcRdRhR'R&ttarget((Rs+/usr/local/lib/python2.7/test/test_heapq.pyttest_comparison_operatorÊs%N(RRR#RR+RR2R6R8R:R<RARERLRORUR\R`Rk(((s+/usr/local/lib/python2.7/test/test_heapq.pyRs 				
													tTestHeapPythoncBseZeZRS((RRRR(((s+/usr/local/lib/python2.7/test/test_heapq.pyRlàssrequires _heapqt	TestHeapCcBseZeZRS((RRRR(((s+/usr/local/lib/python2.7/test/test_heapq.pyRmästLenOnlycBseZdZd„ZRS(s:Dummy sequence class defining __len__ but not __getitem__.cCsdS(Ni
((R((s+/usr/local/lib/python2.7/test/test_heapq.pyt__len__ís(RRt__doc__Ro(((s+/usr/local/lib/python2.7/test/test_heapq.pyRnëstGetOnlycBseZdZd„ZRS(s:Dummy sequence class defining __getitem__ but not __len__.cCsdS(Ni
((Rtndx((s+/usr/local/lib/python2.7/test/test_heapq.pyt__getitem__òs(RRRpRs(((s+/usr/local/lib/python2.7/test/test_heapq.pyRqðstCmpErrcBseZdZd„ZRS(s;Dummy element that always raises an error during comparisoncCs
t‚dS(N(tZeroDivisionError(RRf((s+/usr/local/lib/python2.7/test/test_heapq.pyt__cmp__÷s(RRRpRv(((s+/usr/local/lib/python2.7/test/test_heapq.pyRtõsccsx|D]}|VqWdS(sRegular generatorN((tseqnR'((s+/usr/local/lib/python2.7/test/test_heapq.pytRús
tGcBs eZdZd„Zd„ZRS(sSequence using __getitem__cCs
||_dS(N(Rw(RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRescCs|j|S(N(Rw(RR'((s+/usr/local/lib/python2.7/test/test_heapq.pyRss(RRRpReRs(((s+/usr/local/lib/python2.7/test/test_heapq.pyRyÿs	tIcBs)eZdZd„Zd„Zd„ZRS(s Sequence using iterator protocolcCs||_d|_dS(Ni(RwR'(RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRes	cCs|S(N((R((s+/usr/local/lib/python2.7/test/test_heapq.pyt__iter__scCsD|jt|jƒkr!t‚n|j|j}|jd7_|S(Ni(R'R4Rwt
StopIteration(Rtv((s+/usr/local/lib/python2.7/test/test_heapq.pytnext
s
	(RRRpReR{R~(((s+/usr/local/lib/python2.7/test/test_heapq.pyRzs		tIgcBs eZdZd„Zd„ZRS(s9Sequence using iterator protocol defined with a generatorcCs||_d|_dS(Ni(RwR'(RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRes	ccsx|jD]}|Vq
WdS(N(Rw(Rtval((s+/usr/local/lib/python2.7/test/test_heapq.pyR{s(RRRpReR{(((s+/usr/local/lib/python2.7/test/test_heapq.pyRs	tXcBs eZdZd„Zd„ZRS(s Missing __getitem__ and __iter__cCs||_d|_dS(Ni(RwR'(RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRes	cCsD|jt|jƒkr!t‚n|j|j}|jd7_|S(Ni(R'R4RwR|(RR}((s+/usr/local/lib/python2.7/test/test_heapq.pyR~!s
	(RRRpReR~(((s+/usr/local/lib/python2.7/test/test_heapq.pyRs	tNcBs eZdZd„Zd„ZRS(sIterator missing next()cCs||_d|_dS(Ni(RwR'(RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRe)s	cCs|S(N((R((s+/usr/local/lib/python2.7/test/test_heapq.pyR{,s(RRRpReR{(((s+/usr/local/lib/python2.7/test/test_heapq.pyR‚'s	tEcBs)eZdZd„Zd„Zd„ZRS(sTest propagation of exceptionscCs||_d|_dS(Ni(RwR'(RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRe1s	cCs|S(N((R((s+/usr/local/lib/python2.7/test/test_heapq.pyR{4scCsdddS(Nii((R((s+/usr/local/lib/python2.7/test/test_heapq.pyR~6s(RRRpReR{R~(((s+/usr/local/lib/python2.7/test/test_heapq.pyRƒ/s		tScBs)eZdZd„Zd„Zd„ZRS(sTest immediate stopcCsdS(N((RRw((s+/usr/local/lib/python2.7/test/test_heapq.pyRe;scCs|S(N((R((s+/usr/local/lib/python2.7/test/test_heapq.pyR{=scCs
t‚dS(N(R|(R((s+/usr/local/lib/python2.7/test/test_heapq.pyR~?s(RRRpReR{R~(((s+/usr/local/lib/python2.7/test/test_heapq.pyR„9s		(RHtimapcCs(ttd„ttt|ƒƒƒƒƒS(s Test multiple tiers of iteratorscSs|S(N((R;((s+/usr/local/lib/python2.7/test/test_heapq.pyRVERW(RHR…RxRRy(Rw((s+/usr/local/lib/python2.7/test/test_heapq.pytLCstSideEffectLTcBseZd„Zd„ZRS(cCs||_||_dS(N(tvalueR%(RRˆR%((s+/usr/local/lib/python2.7/test/test_heapq.pyReHs	cCsg|j(|j|jkS(N(R%Rˆ(RRf((s+/usr/local/lib/python2.7/test/test_heapq.pyRgLs
(RRReRg(((s+/usr/local/lib/python2.7/test/test_heapq.pyR‡Gs	tTestErrorHandlingcBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(cCs‘x9|jj|jjfD]}|jttf|dƒqWxN|jj|jj|jj|jj	fD]"}|jttf|ddƒqgWdS(Ni
(
RRRR!R"R$R	RR^RY(RRZ((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_non_sequenceTs
cCsÁx<|jj|jjfD]"}|jttf|tƒƒqWx?|jj|jjfD]%}|jttf|tƒdƒqXWx9|jj	|jj
fD]}|jt|dtƒƒqšWdS(Ni
i(RRRR!R"R$RnR	RR^RY(RRZ((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_len_only[s #cCsÄtƒtƒtƒg}x3|jj|jjfD]}|jt||ƒq1Wx6|jj|jjfD]}|jt||dƒqgWx6|jj|jj	fD]}|jt|d|ƒq WdS(Ni
i(
RtRRRR!RuR	RR^RY(RtseqRZ((s+/usr/local/lib/python2.7/test/test_heapq.pyt
test_get_onlycscCsdx]|jj|jj|jj|jj|jj|jjfD]}|jtt	f|dƒq=WdS(Ni
(
RRRR	RR^RYR!R"R$(RRZ((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_arg_parsinglscCs6x/|jj|jjfD]}xddtdƒdtdddƒfD]ã}xgttttt	fD]P}t
jd	tfd
t
ƒ-|j|d||ƒƒ|d|ƒƒWdQXqcW|j|dt|ƒƒgƒ|jt|dt|ƒƒ|jt|dt|ƒƒ|jt|dt|ƒƒqGWqWdS(
Nt123RWiètdog333333ó?iÐi˜is%comparing unequal types not supportedtquieti(Rg333333ó?(RR^RYRRBRyRzRR†RxRtcheck_py3k_warningstDeprecationWarningR_RR„R!R"RR‚RuRƒ(RRZRMtg((s+/usr/local/lib/python2.7/test/test_heapq.pyttest_iterable_argsrs.2c	seg‰ˆj‡fd†tdƒDƒƒ|jttfƒ!|jjˆtdˆƒƒWdQXdS(Nc3s|]}t|ˆƒVqdS(N(R‡(RFR'(R%(s+/usr/local/lib/python2.7/test/test_heapq.pys	<genexpr>ƒsiÈi(textendRR!R7tRuntimeErrorRR	R‡(R((R%s+/usr/local/lib/python2.7/test/test_heapq.pyttest_heappush_mutating_heaps#csYg‰ˆj‡fd†tdƒDƒƒ|jttfƒ|jjˆƒWdQXdS(Nc3s|]}t|ˆƒVqdS(N(R‡(RFR'(R%(s+/usr/local/lib/python2.7/test/test_heapq.pys	<genexpr>ŠsiÈ(R–RR!R7R—RR(R((R%s+/usr/local/lib/python2.7/test/test_heapq.pyttest_heappop_mutating_heapˆs#N(RRR#RRŠR‹RRŽR•R˜R™(((s+/usr/local/lib/python2.7/test/test_heapq.pyR‰Qs							tTestErrorHandlingPythoncBseZeZRS((RRRR(((s+/usr/local/lib/python2.7/test/test_heapq.pyRšstTestErrorHandlingCcBseZeZRS((RRRR(((s+/usr/local/lib/python2.7/test/test_heapq.pyR›”scCs tttttg}tj|Œ|rœttdƒrœddl	}dgd}xAtt|ƒƒD]-}tj|Œ|j
ƒtjƒ||<qcW|GHndS(Ntgettotalrefcountiÿÿÿÿi(RRlRmRšR›Rtrun_unittestthasattrtsystgcR#RBR4tcollectRœ(tverbosettest_classesR tcountsR'((s+/usr/local/lib/python2.7/test/test_heapq.pyt	test_mainœs	



t__main__R¢(((((((((((('RpRŸRttestRtunittestRRtimport_fresh_moduleRRRRRRlRmRnRqRtRxRyRzRRR‚RƒR„t	itertoolsRHR…R†R‡R‰RšR›R#R¥RR_(((s+/usr/local/lib/python2.7/test/test_heapq.pyt<module>sDÄ	
	
		
?

Zerion Mini Shell 1.0