Current File : //opt/imh-python/lib/python2.7/test/test_capi.pyo
�
��Wc@�s3ddlmZddlZddlZddlZddlZddlmZyddl	Z	ddl
Z
Wnek
r�dZ	dZ
nXej
d�Zdejfd��YZeje
d�dejfd	��Y�Zeje
o�e	d�d
ejfd��Y�Zd�Zed
kr/e�ndS(i����(twith_statementN(ttest_supportt	_testcapitCAPITestcB�seZd�ZRS(cC�stj�dS(N(Rttest_buildvalue_N(tself((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyRs(t__name__t
__module__R(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyRss!Threading required for this test.tTestPendingCallscB�s8eZd�Zdd�Zd�Zd�Zd�ZRS(c�sa�fd�}xKt|�D]=}tjtj�d�xtrXtj|�r<Pq<q<WqWdS(Nc�s�jd�dS(N(tappendtNone((tl(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pytcallbacksg{�G�z�?(trangettimetsleeptrandomtTrueRt_pending_threadfunc(RRtnRti((Rsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pytpendingcalls_submits	cC�s�d}x�t|�|kr�tr>tjr>dt|�fGnxtd�D]}||}qKW|r{|jj�r{q	n|d7}|j|dkd|t|�f�q	Wtr�tjr�dt|�fGHndS(Nis(%i)i�ii's(timeout waiting for %i callbacks, got %i(tlentFalsetsupporttverbosetxrangeteventtis_sett
assertTrue(RRRtcontexttcountRta((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pytpendingcalls_wait+s
cC�s�d}g}dtfd��Y}|�}g|_d|_||j|_d|_tj�|_tj�|_	gt
|j�D]$}tjd|jd|f�^q�}t
j|��|j|j||�WdQXdS(Ni tfoocB�seZRS((RR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyR"Bsiittargettargs(tobjectRRtnThreadst	nFinishedt	threadingtLocktlocktEventRR
tThreadtpendingcalls_threadRt
start_threadsR!(RRtthreadsR"RR((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyttest_pendingcalls_threaded>s				7c
C�s�z|j|j|j�Wd|j�8|jd7_|j}trZtjrZdG|GHnWdQX||jkr|j	j
�nXdS(Nisfinished threads: (RRRR*R'RRRR&Rtset(RRR'((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyR-Qs
	cC�s0g}d}|j||�|j||�dS(Ni@(RR!(RRR((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyttest_pendingcalls_non_threaded]sN(RRRR
R!R0R-R2(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyRs
			tTestThreadStatecB�seZejd��ZRS(c�s@�fd�}|�tjd|�}|j�|j�dS(Nc�s_g��fd�}tj|�|}}tjd��j�jtj��dd�dS(Nc�s�jtj��dS(N(R	tthreadt	get_ident((tidents(sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyRqsiis/Couldn't find main thread correctly in the list(Rt_test_thread_stateRRtassertEqualRR4R5(RR tb(R(R6sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyR#ns


R#(R(R,tstarttjoin(RR#tt((Rsg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyttest_thread_stateks


(RRRtreap_threadsR=(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyR3hscC�s�x�tt�D]t}|jd�r
tt|�}tjrFdG|GHny|�Wq�tjk
r}tjtj	�d�q�Xq
q
Wtj
ttt
�dS(Nttest_tinternali(tdirRt
startswithtgetattrRRterrort
TestFailedtsystexc_infotrun_unittestRRR3(tnamettest((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyt	test_main�s	!t__main__(t
__future__RRFRRtunittestRJRRR4R(tImportErrorR
t
import_moduleRtTestCaseRt
skipUnlessRR3RKR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_capi.pyt<module>s(

N