Current File : //opt/imh-python/lib/python2.7/test/test_sort.pyc
�
��Wc@s�ddlmZddlZddlZddlZejZdadd�Zdej	fd��YZ
dej	fd��YZd	ej	fd
��YZdd�Z
edkr�e
d
e�ndS(i����(ttest_supportNicCs�trdG|GHn|}|r/|j|�n
|j�t|�t|�kr�dG|GHdGt|�Gt|�GH|GH|GH|GHtd7adSxgt|�D]Y\}}||}||k	r�dG|GHdG|G|G|GH|GH|GH|GHtd7adSq�WdS(Ns    checkingserror inslength mismatch;isout of order at index(tverbosetsorttlentnerrorst	enumerate(ttagtexpectedtrawtcomparetorigtitgoodtmaybe((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pytcheck	s0
	

	
tTestBasecBseZd�ZRS(cs�dg}x?tdd�D].}d|}|jt|d|d��qW|jdddg�dtf�fd��Y�d	tfd
��Y}x|D]}t|�}tr�dG|GHn|}td||�|}|j�td
||�|}tj|�td||�|}|j�|}td||d��tr[dGHdGHn|}|jd��td||�g|D]}�|�^q�}|}tj|�t	�_
t}	y|j�Wntk
r�t	}	nX|	rt�_
td||�ngt
|�D]}|tjd�|�^q}g|D]}
|
|
jf^qF}|j�g|D]\}
}|
^qr}td||�q�WdS(Niii
iidi�t	Complainscs/eZeZd�Z�fd�Zd�ZRS(cSs
||_dS(N(R(tselfR((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt__init__5scsJ�jr:tj�dkr:tr1dG|G|GHnt�n|j|jkS(Ng����MbP?s        complaining at(tmaybe_complaintrandomRtRuntimeErrorR(Rtother(R(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt__lt__8s
	cSsd|jS(Ns
Complains(%d)(R(R((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt__repr__?s(t__name__t
__module__tTrueRRRR((R(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR2s	tStablecBs)eZd�Zd�ZdZd�ZRS(cSs||_||_dS(N(tkeytindex(RRR((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyRCs	cSst|j|j�S(N(tcmpR(RR((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt__cmp__GscSsd|j|jfS(NsStable(%d, %d)(RR(R((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyRKsN(RRRR tNonet__hash__R(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyRBs		sTesting sizetidentitytreversedsrandom permutationsreversed via functioncSs
t||�S(N(R(tatb((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt<lambda>ass3    Checking against an insane comparison function.s?        If the implementation isn't careful, this may segfault.cSsttj�d�dS(Nii(tintR(R%R&((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'gss(an insane function left some permutations+exception during sort left some permutationt	stability(trangetextendtobjectRRtreverseRtshuffleRRRtFalseRtxranget	randrangeR(RtsizestpowertnRtxtstyRt
it_complainedtet	augmented((Rsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttestStressfully*s\	
"




	

	1"
(RRR;(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR)stTestBugscBs#eZd�Zd�Zd�ZRS(csRdd�fd��Y}gtd�D]}|�^q&�|jt�j�dS(NtCcseZ�fd�ZRS(csB�r%tj�dkr%�j�n
�jd�tj�dkS(Ng�?ig�?(Rtpoptappend(RR(tL(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR�s

(RRR((R@(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR=�si2((R*tassertRaisest
ValueErrorR(RR=R((R@sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_bug453523�s"cCs@td�}tj|�|jd�|j|td��dS(Ni2(R*RR.RR!tassertEqual(RR@((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_cmpNone�s

cs�g}xstd�D]e}�fd�}ddg�|jt�j|��fd�}|jt�j|�|g}qWdS(Nics$�jd��j�t||�S(Ni(R?R>R(R5R7(R@(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pytmutating_cmp�s

iics�jd��2t||�S(Ni(R?R(R5R7(R@(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyRF�s
(R*RARBR(RtmemorywasterRRF((R@sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_undetected_mutation�s(RRRCRERH(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR<s		tTestDecorateSortUndecoratecBskeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cCsJdj�}|}tj|�|jdtj�|jdd��dS(Ns,The quick Brown fox Jumped over The lazy DogRRcSst|j�|j��S(N(Rtlower(R5R7((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'�s(tsplitRR.RtstrRJ(Rtdatatcopy((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_decorated�s

cCs,dj�}|jt|jdd��dS(Ns,The quick Brown fox Jumped over The lazy DogcSsdS(Ni((R5R7((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'�s(RKRAt	TypeErrorRR!(RRM((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_baddecorator�scCsfgtd�D]}tjd�|f^q
}|}|jdd��|j�|j||�dS(Ni�idRcSs|dS(Ni((R5((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'�s(R0RR1RRD(RRRMRN((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_stability�s
.
cs8�fd�}dj�}|jd|dtj�dS(Ncs9�jt|�t��jt|�t�t||�S(N(RDttypeRLR(R5R7(R(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR	�ss,The quick Brown fox Jumped over The lazy DogRR(RKRRLRJ(RR	RM((Rsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_cmp_and_key_combination�scCs,dj�}|jt|jdtj�dS(Ns,The quick Brown fox Jumped over The lazy Dogtbad(RKRARPRRLRJ(RRM((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_badcmp_with_key�scCsFtdd�}|}|jt|jdd��|j||�dS(Ni����icSsd|S(Ni((R5((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'�s(R*RAtZeroDivisionErrorRR!RD(RRMtdup((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_key_with_exception�scs8td���fd�}|jt�jd|�dS(Ni
cs�2td��(|S(Ni(R*(R5(RM(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pytk�s
R(R*RARBR(RRZ((RMsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_key_with_mutation�scsEtd��dtf�fd��Y}|jt�jd|�dS(Ni
t
SortKillercs eZd�Z�fd�ZRS(cSsdS(N((RR5((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR�scs�2td��(dS(Ni(R*(R(RM(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt__del__�s(RRRR]((RM(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR\�s	R(R*R,RARBR(RR\((RMsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_key_with_mutating_del�scsEtd��dtf�fd��Y}|jt�jd|�dS(Ni
R\cs eZd�Z�fd�ZRS(cSs|dkrt�ndS(Ni(R(RR5((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR�scs�2td��(dS(Ni(R*(R(RM(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR]�s(RRRR]((RM(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR\�s	R(R*R,RARR(RR\((RMsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt(test_key_with_mutating_del_and_exception�scCs_td�}tj|�|jdt�|j|tddd��|jt|jd�dS(NidR-ici����s
wrong type(R*RR.RRRDRARP(RRM((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_reverse�s

cCs�gtd�D]}tjd�|f^q
}|}|}|jdd�dt�|jdd��|j||�|jdd�dt�|j||�dS(	Ni�idRcSst|d|d�S(Ni(R(R5R7((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'sR-cSst|d|d�S(Ni(R(R5R7((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'sRcSs|dS(Ni((R5((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyR'	s(R0RR1RRRD(RRRMtcopy1tcopy2((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyttest_reverse_stabilitys.(
RRRORQRRRTRVRYR[R^R_R`Rc(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyRI�s									
		cCs�tttf}tjdtf���tj|�|r�ttd�r�ddl	}dgd}xAtt|��D]-}tj|�|j
�tj�||<qsW|GHnWdQXdS(Ns!the cmp argument is not supportedtgettotalrefcounti����i(RRIR<Rtcheck_py3k_warningstDeprecationWarningtrun_unittestthasattrtsystgcR!R0RtcollectRd(Rttest_classesRjtcountsR((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt	test_mains	



t__main__R(ttestRRRitunittestRRR!RtTestCaseRR<RIRnRR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_sort.pyt<module>s	 V-b