Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.145.102.112
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_queue.pyo
�
?��cc@sMddlZddlZddlZddlmZejd�ZdZdejfd��YZ	ddd��YZ
d	e
fd
��YZdeejfd��YZ
d
eejfd��YZdeejfd��YZdefd��YZdejfd��YZde
ejfd��YZd�ZedkrIe�ndS(i����N(ttest_supportt	threadingit_TriggerThreadcBseZd�Zd�ZRS(cCs5||_||_tj�|_tjj|�dS(N(tfntargsRtEventtstartedEventtThreadt__init__(tselfRR((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyR
s		cCs.tjd�|jj�|j|j�dS(Ng�������?(ttimetsleepRtsetRR(R	((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytruns	

(t__name__t
__module__RR
(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRs	tBlockingTestMixincBs#eZd�Zd�Zd�ZRS(cCs
d|_dS(N(tNonett(R	((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyttearDown.scCs�t||�|_|jj�||�|_|jjj�sT|jd|�n|jjd�|jj�r�|jd|�n|jS(Ns,blocking function '%r' appeared not to blocki
s,trigger function '%r' appeared to not return(	RRtstarttresultRtis_settfailtjointis_alive(R	t
block_funct
block_argsttrigger_functtrigger_args((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytdo_blocking_test1s
		cCs�t||�|_|jj�z:y||�Wn|k
rF�nX|jd|�Wd|jjd�|jj�r�|jd|�n|jjj�s�|jd�nXdS(Nsexpected exception of kind %ri
s,trigger function '%r' appeared to not returns(trigger thread ended but event never set(RRRRRRRR(R	RRRRtexpected_exception_class((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytdo_exceptional_blocking_test@s

		(RRRRR (((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyR,s		t
BaseQueueTestcBsGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsd|_tj�|_dS(Ni(tcumRtLocktcumlock(R	((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytsetUpVs	c	Cs�|j�std�n|jd�|jd�|jd�tddddgddddgddddg�}|j�|j�|j�g}|j|||jjd�x<tt	d	�D]*}|j|�|j
|j�d
�q�W|j
|j�d�dt	}dt	}|j|�|j
|j�d�y$|j|dd�|jd�Wnt
jk
rznXy$|j|dd�|jd�Wnt
jk
r�nX|j|j|f|jd�|j|j|tdf|jd�xtt	�D]}|j�qW|j
|j�d�y!|jdd�|jd�Wnt
jk
rhnXy!|jdd�|jd�Wnt
jk
r�nX|j|jd|jd�|j|jtdf|jd�dS( Ns&Call this function with an empty queueioiMi�tQueuet	LifoQueuet
PriorityQueues&Didn't seem to queue the correct data!isQueue should not be emptysQueue should not be fulliisQueue should be fulltblockis(Didn't appear to block with a full queuettimeoutg{�G�z�?s+Didn't appear to time-out with a full queuei
sQueue should be emptys*Didn't appear to block with an empty queues-Didn't appear to time-out with an empty queuetemptyi((((R+(R+(R+tRuntimeErrortputtdicttgettassertEqualt	__class__Rtranget
QUEUE_SIZEt
assertTruetfullRR&tFullRtTruetEmpty(R	tqttarget_ordertactual_ordertitlastR5((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytsimple_queue_testZs\


!



%cCs`xYtr[|j�}|dkr/|j�dS|j�|j|7_WdQX|j�qWdS(N(R7R/Rt	task_doneR$R"(R	R9tx((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytworker�s	

cCs�d|_x0dD](}tjd|jd|f�j�qWx!td�D]}|j|�qIW|j�|j|jt	t
d��d�xdD]}|jd�q�W|j�dS(	NiittargetRids0q.join() did not block until all tasks were done(ii(ii(R"RRRARtxrangeR-RR0tsumR2R(R	R9R<((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytqueue_join_test�s	
&

cCs?|j�}y|j�Wntk
r-nX|jd�dS(Ns(Did not detect task count going negative(t	type2testR?t
ValueErrorR(R	R9((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyttest_queue_task_done�s
cCsY|j�}|j|�|j|�y|j�Wntk
rGnX|jd�dS(Ns(Did not detect task count going negative(RFRER?RGR(R	R9((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyttest_queue_join�s


cCs-|jt�}|j|�|j|�dS(N(RFR3R>(R	R9((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyttest_simple_queue�s
(	RRR%R>RARERHRIRJ(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyR!Us		5	
	
	
	
t	QueueTestcBseZejZRS((RRR&RF(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRK�st
LifoQueueTestcBseZejZRS((RRR&R'RF(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRL�stPriorityQueueTestcBseZejZRS((RRR&R(RF(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRM�stFailingQueueExceptioncBseZRS((RR(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRN�stFailingQueuecBs#eZd�Zd�Zd�ZRS(cGs)t|_t|_tjj||�dS(N(tFalset
fail_next_putt
fail_next_getR&R(R	R((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyR�s		cCs1|jrt|_td�ntjj||�S(NsYou Lose(RQRPRNR&t_put(R	titem((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRS�s		cCs.|jrt|_td�ntjj|�S(NsYou Lose(RRRPRNR&t_get(R	((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRU�s		(RRRRSRU(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRO�s		tFailingQueueTestcBseZd�Zd�ZRS(cCs�|j�std�nx%ttd�D]}|j|�q)Wt|_y$|jddd�|jd�Wntk
r�nXt|_y$|jddd�|jd�Wntk
r�nX|jd	�|j	|j
�d
�t|_y-|j|jd|jd�|jd�Wntk
r.nX|jd	�t|_y9|j
|jdtdf|jdt�|jd�Wntk
r�nX|jd	�|j	|j
�d
�|j�|j	|j
�d
�|jd	�|j	|j
�d
�|j|jd|jd�xtt�D]}|j�q"W|j	|j�d�|jd�t|_y|j�|jd�Wntk
r�nX|j	|j�d�t|_y!|jdd�|jd�Wntk
r�nX|j	|j�d�|j�|j	|j�d�t|_y0|j
|jd|jdt�|jd�Wntk
rinX|j	|j�d�|j�|j	|j�d�dS(Ns&Call this function with an empty queueitoopsR)is)The queue didn't fail when it should haveR*g�������?R=sQueue should be fullR5i
sQueue should not be fullsQueue should be emptytfirstsQueue should not be emptyR+(R5(((R5(((R+(R+R,R2R3R-R7RQRRNR4R5RR/R RR(R	R9R<((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pytfailing_queue_test�s�	
	

	

	!




	

	

	

cCs*tt�}|j|�|j|�dS(N(ROR3RY(R	R9((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyttest_failing_queue7s
(RRRYRZ(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyRV�s	QcCstjtttt�dS(N(Rtrun_unittestRKRLRMRV(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyt	test_main?st__main__((R&R
tunittestttestRt
import_moduleRR3RRRR!tTestCaseRKRLRMt	ExceptionRNRORVR\R(((s6/usr/local/python-2.7/lib/python2.7/test/test_queue.pyt<module>s" )p[	
© 2025 GrazzMean