Current File : //opt/imh-python/lib/python2.7/test/test_kqueue.pyo
�
��Wc@s�dZddlZddlZddlZddlZddlZddlZddlmZe	ed�sej
d��ndejfd��YZd�Z
ed	kr�e
�ndS(
s
Tests for kqueue wrapper.
i����N(ttest_supporttkqueuestest works only on BSDt
TestKQueuecBs,eZd�Zd�Zd�Zd�ZRS(cCsptj�}|j|j�dk|j��|j|j�|j�|j|j�|jt|j�dS(Ni(tselectRt
assertTruetfilenotclosedtclosetassertRaisest
ValueError(tselftkq((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyttest_create_queues"
cCsutjj�}tj|�}tjd�}|j|j|�|j|jtj�|j|j	tj
�|j|jd�|j|jd�|j|j
d�|j||�|j||�|jt||�d�|j||k�|j||k�|jtt|d�|jtt|d�|jtt|d�tj|tj�}|j|j|�|j|jtj�|j|j	tj
�|j|jd�|j|jd�|j|j
d�|j||�|j||�tj|tjtj�}|j|j|�|j|jtj�|j|j	tj�|j|jd�|j|jd�|j|j
d�|j||�|j||�tjddddd	d
�}|j|jd�|j|jd�|j|j	d�|j|jd�|j|jd	�|j|j
d
�|j||�|j||�d}tj|ddd|d|�}|j|j|�|j|jd�|j|j	d�|j|jd�|j|j|d�|j|j
|�|j||�|j||�d}tjdd|�}|j|jd�|j|jd�|j|j	|�|j|jd�|j|jd�|j|j
d�|j||�|j||�d
}tjddd|�}|j|jd�|j|jd�|j|j	d�|j|j|�|j|jd�|j|j
d�|j||�|j||�dS(Ni�ii����iteviiiiii�i��I����(tsyststderrRRtkeventtassertEqualtidenttfiltertKQ_FILTER_READtflagst	KQ_EV_ADDtfflagstdatatudatatassertNotEqualtcmpRRt	TypeErrortNonetKQ_FILTER_WRITEt
KQ_EV_ONESHOT(R
tfdR
tothertbignum((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyttest_create_events�"cCstj�}|jd�|jd�tj�}|jt�y!|jd|j�df�Wn0tjk
r�}|j|j	dt
j�nX|j�\}}t
j�}t
jj|j��}t
j|j�t
jt
jt
jB�}|j|gd�t
j|j�t
jt
jt
jB�}|j|gd�t
j|j�t
jt
jt
jB�}|j|gd�t
j|j�t
jt
jt
jB�}|j|gd�|jddd�}	td�|	D��}	|j|	t|j�t
jf|j�t
jfg��|jd�|jd�xYtd�D]>}
|jddd�}	t|	�dkrrPntjd	�qAW|jd
�td�|	D��}	|j|	t|j�t
jf|j�t
jf|j�t
jf|j�t
jfg��t
j|j�t
jt
j�}|j|gd�t
j|j�t
jt
j�}|j|gd�t
j|j�t
jt
j�}|j|gdd�|jgdd�}	td
�|	D��}	|j|	t|j�t
jfg��|j �|j �|j �dS(Ns	127.0.0.1iiicss!|]}|j|jfVqdS(N(RR(t.0te((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pys	<genexpr>�ssHello!sworld!!!i
g�?s'timeout waiting for event notificationscss!|]}|j|jfVqdS(N(RR(R$R%((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pys	<genexpr>�sg�G�z��?css!|]}|j|jfVqdS(N(RR(R$R%((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pys	<genexpr>�s(s	127.0.0.1i(!tsockettbindtlistentsetblockingtFalsetconnecttgetsocknameterrorRtargsterrnotEINPROGRESStacceptRRtfromfdRRRRtKQ_EV_ENABLEtcontrolRRtsettsendtrangetlenttimetsleeptfailtKQ_EV_DELETER(R
tserverSockettclientR%tservertaddrRtkq2R
teventsti((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyttest_queue_eventms�


!




cCs�tj�}tj�\}}|jd�tj|tjtjtjB�}tj|tjtjtjB�}|j	||gdd�}|j
|�|j|djtj
@�|j|j|dj�d�|j�|j�|j�dS(Ntfooii(RRR&t
socketpairR6RRRR3R4RtassertFalseRtKQ_EV_ERRORRtrecvRR(R
Rtatbtevent1tevent2tr((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyttestPair�s
""
 

(t__name__t
__module__RR#RDRO(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyRs		U	ScCstjt�dS(N(Rtrun_unittestR(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyt	test_main�st__main__(t__doc__R&R/R9RRtunittestttestRthasattrtSkipTesttTestCaseRRSRP(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_kqueue.pyt<module>s�