Current File : //opt/imh-python/lib/python2.7/test/test_timeout.pyc
�
��Wc@s�dZddlZddlmZejd�ZddlZddlZdejfd��YZ	dejfd��YZ
d	�Zed
kr�e�ndS(s&Unit tests for socket timeout feature.i����N(ttest_supporttnetworktCreationTestCasecBs_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
s9Test case for socket.gettimeout() and socket.settimeout()cCstjtjtj�|_dS(N(tsockettAF_INETtSOCK_STREAMtsock(tself((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pytsetUpscCs|jj�dS(N(Rtclose(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttearDownscCs |j|jj�dd�dS(Nstimeout not disabled by default(tassertEqualRt
gettimeouttNone(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestObjectCreationscCs|jjd�|j|jj�d�|jjd�|j|jj�d�|jjd�|j|jj�d�dS(Ng�z�Ga@i(Rt
settimeoutRRR
(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestFloatReturnValuescCsn|jjd�|jt|jj��td��|jjd�|jt|jj��td��dS(Nig�?g333333@(RRRttypeR(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestReturnType&s%cCs�|jjd�|jjd�|jjd�|jjd�|jt|jjd�|jt|jjd�|jt|jjd�|jt|jjg�|jt|jji�|jt|jjd�dS(Nilgtuy((RRR
tassertRaisest	TypeError(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyt
testTypeCheck.scCsO|jt|jjd�|jt|jjd�|jt|jjd�dS(Ni����l����g�(Rt
ValueErrorRR(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestRangeCheck;scCs�|jjd�|jjd�|j|jj�d�|jjd�|j|jj�d�|jjd�|jjd�|j|jj�d�|jjd�|j|jj�d�dS(Ni
iig(RRtsetblockingRRR
(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestTimeoutThenBlockingAscCsv|jjd�|jjd�|j|jj�d�|jjd�|jjd�|j|jj�d�dS(Nii(RRRRR(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestBlockingThenTimeoutOs(t__name__t
__module__t__doc__RR
RRRRRRR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyR
s						
		tTimeoutTestCasecBs�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	e
jd�d	��Ze
jd�d
��Z
e
jd�d��ZRS(s/Test case for socket.socket() timeout functionsg@cCs1tjtjtj�|_d|_d|_dS(Nswww.python.org.iPs	127.0.0.1(swww.python.org.iP(RRRRtaddr_remotet	localhost(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyRes	cCs|jj�dS(N(RR	(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyR
jscCs�d}d}|jj|�tj�}|jtj|jj|�tj�}t||�}|j|||j	kd||j	|f�dS(Ns10.0.0.0i90g����MbP?s<timeout (%g) is more than %g seconds more than expected (%g)(s10.0.0.0i90(
RRttimeRRterrortconnecttabst
assertTruetfuzz(Rtaddrt_timeoutt_t1t_t2t_delta((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestConnectTimeoutmsc
Cs�d}tj|jd���|jj|j�|jj|�tj�}|jtj	|jj
d�tj�}t||�}|j|||j
kd||j
|f�WdQXdS(Ng{�G�z�?iis2timeout (%g) is %g seconds more than expected (%g)(Rttransient_internetR RR$RR"RRttimeouttrecvR%R&R'(RR)R*R+R,((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestRecvTimeout�scCs�d}|jj|�tj|j|j�|jjd�tj�}|jtj	|jj
�tj�}t||�}|j|||j
kd||j
|f�dS(Niis2timeout (%g) is %g seconds more than expected (%g)(RRRt	bind_portR!tlistenR"RRR#tacceptR%R&R'(RR)R*R+R,((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestAcceptTimeout�scCs�d}tjtjtj�|_|jj|�tj|j|j�tj�}|j	tj
|jjd�tj�}t||�}|j
|||jkd||j|f�dS(Nii s2timeout (%g) is %g seconds more than expected (%g)(RRt
SOCK_DGRAMRRRR2R!R"RR#trecvfromR%R&R'(RR)R*R+R,((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestRecvfromTimeout�sstest not implementedcCsdS(N((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestSend�scCsdS(N((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyt
testSendto�scCsdS(N((R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyttestSendall�s(RRRR'RR
R-R1R5R8tunittesttskipR9R:R;(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyRZs						cCs!tjd�tjtt�dS(NR(Rtrequirestrun_unittestRR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyt	test_main�s
t__main__(
RR<ttestRtis_resource_enabledt
skip_expectedR"RtTestCaseRRR@R(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_timeout.pyt<module>sMn