%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_asynchat.pyo

ó
Nêáac@s™ddlZddlZddlZddlZddlZddlZddlZddlmZyddl	Z	Wne
k
rdZ	nXejZdZ
e	ráde	jfd„ƒYZdejfd„ƒYZd„Zneje	d	ƒd
ejfd„ƒYƒZdefd
„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdd„Zedkr•edeƒndS(iÿÿÿÿN(ttest_supportsQUIT
techo_servercBs eZdZd„Zd„ZRS(icCsVtjj|ƒ||_tjtjtjƒ|_tj	|jƒ|_
d|_dS(N(
t	threadingtThreadt__init__teventtsockettAF_INETtSOCK_STREAMtsockRt	bind_porttporttNonetstart_resend_event(tselfR((s./usr/local/lib/python2.7/test/test_asynchat.pyRs
	cCs|jjdƒ|jjƒ|jjƒ\}}d|_x<t|jkry|jdƒ}|sfPn|j||_q>W|jjtdƒ|_|j	r«|j	j
ƒnyJxC|jró|j|j|j ƒ}t
jdƒ|j||_q±WWnnX|jƒ|jjƒdS(Nitgü©ñÒMbP?(R	tlistenRtsettaccepttbuffertSERVER_QUITtrecvtreplaceR
twaittsendt
chunk_sizettimetsleeptclose(Rtconntclienttdatatn((s./usr/local/lib/python2.7/test/test_asynchat.pytrun"s*
		

(t__name__t
__module__RRR!(((s./usr/local/lib/python2.7/test/test_asynchat.pyRs		techo_clientcBsGeZd„Zd„Zejdkr3d„Znd„Zd„ZRS(cCs\tjj|ƒg|_|jtjtjƒ|jt	|fƒ|j
|ƒd|_dS(NR(tasynchatt
async_chatRtcontentst
create_socketRRRtconnecttHOSTtset_terminatorR(Rt
terminatortserver_port((s./usr/local/lib/python2.7/test/test_asynchat.pyRDs	
cCsdS(N((R((s./usr/local/lib/python2.7/test/test_asynchat.pythandle_connectLstdarwincCsdS(N((R((s./usr/local/lib/python2.7/test/test_asynchat.pythandle_exptRscCs|j|7_dS(N(R(RR((s./usr/local/lib/python2.7/test/test_asynchat.pytcollect_incoming_dataUscCs |jj|jƒd|_dS(NR(R'tappendR(R((s./usr/local/lib/python2.7/test/test_asynchat.pytfound_terminatorXs(	R"R#RR.tsystplatformR0R1R3(((s./usr/local/lib/python2.7/test/test_asynchat.pyR$Bs			cCsMtjƒ}t|ƒ}|jƒ|jƒ|jƒtjdƒ||fS(Ng{®Gáz„?(RtEventRtstartRtclearRR(Rts((s./usr/local/lib/python2.7/test/test_asynchat.pytstart_echo_server]s



s!Threading required for this test.tTestAsynchatcBsŒeZeZd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„ZRS(cCstjƒ|_dS(N(Rtthreading_setupt_threads(R((s./usr/local/lib/python2.7/test/test_asynchat.pytsetUpkscCstj|jŒdS(N(Rtthreading_cleanupR=(R((s./usr/local/lib/python2.7/test/test_asynchat.pyttearDownnscCsàtjƒ}t|ƒ}||_|jƒ|jƒ|jƒtjdƒt	||j
ƒ}|jdƒ|jd|ƒ|jd|ƒ|jtƒt
jd|jddddƒ|jƒ|j|jd	d
gƒdS(Ng{®Gáz„?shello sworld%ssI'm not dead yet!%stuse_polltcounti,ttimeoutshello worldsI'm not dead yet!(RR6RRR7RR8RRR$RtpushRtasyncoretlooptusepolltjointassertEqualR'(Rttermtserver_chunkRR9tc((s./usr/local/lib/python2.7/test/test_asynchat.pytline_terminator_checkqs	






cCs%xdD]}|jd|ƒqWdS(Niiis
(iii(RM(Rtl((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_line_terminator1‡s
cCs%xdD]}|jd|ƒqWdS(Niiis
(iii(RM(RRN((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_line_terminator2Œs
cCs%xdD]}|jd|ƒqWdS(Niiitqqq(iii(RM(RRN((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_line_terminator3‘s
cCsˆtƒ\}}t||jƒ}d}|j|ƒ|jtƒtjd|jddddƒ|jƒ|j	|j
|| gƒdS(Nshello world, I'm not dead yet!
RARBi,RCg{®Gáz„?(R:R$RRDRRERFRGRHRIR'(RttermlenR9RRLR((s./usr/local/lib/python2.7/test/test_asynchat.pytnumeric_terminator_check–s


cCs|jdƒ|jdƒdS(Nil(RT(R((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_numeric_terminator1¢s
cCs|jdƒdS(Nl(RT(R((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_numeric_terminator2¨scCs”tƒ\}}td|jƒ}d}|j|ƒ|jtƒtjd|jddddƒ|j	ƒ|j
|jgƒ|j
|j|ƒdS(Nshello world, I'm not dead yet!
RARBi,RCg{®Gáz„?(
R:R$RRRDRRERFRGRHRIR'R(RR9RRLR((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_none_terminator«s


cCs“tƒ\}}td|jƒ}d}tj|tddƒ}|j|ƒtjd|j	dddd	ƒ|j
ƒ|j|jd
dgƒdS(Ns
shello world
I'm not dead yet!
tbuffer_sizeiRARBi,RCg{®Gáz„?shello worldsI'm not dead yet!(
R:R$RR%tsimple_producerRtpush_with_producerRERFRGRHRIR'(RR9RRLRtp((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_simple_producer¸s

cCs~tƒ\}}td|jƒ}d}|j|tƒtjd|jddddƒ|jƒ|j	|j
dd	gƒdS(
Ns
shello world
I'm not dead yet!
RARBi,RCg{®Gáz„?shello worldsI'm not dead yet!(R:R$RRZRRERFRGRHRIR'(RR9RRLR((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_string_producerÃs
cCs„tƒ\}}td|jƒ}|jdƒ|jtƒtjd|jddddƒ|jƒ|j	|j
dd	d
gƒdS(Ns
shello world

I'm not dead yet!
RARBi,RCg{®Gáz„?shello worldRsI'm not dead yet!(R:R$RRDRRERFRGRHRIR'(RR9RRL((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_empty_lineÍs


cCs½tƒ\}}tjƒ|_td|jƒ}|jdƒ|jtƒ|jƒt	j
d|jddddƒ|jjƒ|j
ƒ|j|jgƒ|jt|jƒdkƒdS(	Ns
shello world
I'm not dead yet!
RARBi,RCg{®Gáz„?i(R:RR6R
R$RRDRtclose_when_doneRERFRGRRHRIR't
assertTruetlenR(RR9RRL((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_close_when_doneØs




(R"R#tFalseRGR>R@RMRORPRRRTRURVRWR\R]R^Rb(((s./usr/local/lib/python2.7/test/test_asynchat.pyR;gs										
		
	tTestAsynchat_WithPollcBseZeZRS((R"R#tTrueRG(((s./usr/local/lib/python2.7/test/test_asynchat.pyRdïstTestAsynchatMockedcBseZd„ZRS(cCsiddd„ƒY}dtjfd„ƒY}|ƒ}|ƒ}|j|ƒ|j|jƒ|jƒdS(Ntfake_socketcBseZd„Zd„ZRS(cSsdS(Ni((R((s./usr/local/lib/python2.7/test/test_asynchat.pytfilenoøscSstjtjdƒ‚dS(NtEAGAIN(RterrorterrnoRi(Rtsize((s./usr/local/lib/python2.7/test/test_asynchat.pyRûs(R"R#RhR(((s./usr/local/lib/python2.7/test/test_asynchat.pyRg÷s	tMyChatcBseZd„ZRS(cSstdƒ‚dS(NRj(t	Exception(R((s./usr/local/lib/python2.7/test/test_asynchat.pythandle_errorÿs(R"R#Ro(((s./usr/local/lib/python2.7/test/test_asynchat.pyRmþs((R%R&t
set_sockett
addCleanuptdel_channelthandle_read(RRgRmR	t
dispatcher((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_blockingioerrorôs		
(R"R#Ru(((s./usr/local/lib/python2.7/test/test_asynchat.pyRfóstTestHelperFunctionscBseZd„ZRS(cCs<|jtjddƒdƒ|jtjddƒdƒdS(Nsqwerty
s
it
qwertydkjfi(RIR%tfind_prefix_at_end(R((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_find_prefix_at_ends(R"R#Ry(((s./usr/local/lib/python2.7/test/test_asynchat.pyRvstTestFifocBseZd„Zd„ZRS(cCstjƒ}|jdƒ|jdƒ|jt|ƒdƒ|j|jƒdƒ|j|jƒdƒ|jt|ƒdƒ|j|jƒdƒ|j|jƒtƒ|j|jƒdƒ|jt|ƒdƒ|j|jƒt	ƒ|j|jƒdƒdS(	Nitaiii(ii(iR{(iN(R%tfifoRDRIRatfirsttpoptis_emptyRcReR(Rtf((s./usr/local/lib/python2.7/test/test_asynchat.pyt
test_basics

cCsŠtjdddgƒ}|jt|ƒdƒ|j|jƒdƒ|j|jƒdƒ|j|jƒdƒ|j|jƒd	ƒdS(
Ntxiiii(iR‚(ii(ii(iN(R%R|RIRaR~R(RR€((s./usr/local/lib/python2.7/test/test_asynchat.pyttest_given_list s(R"R#RRƒ(((s./usr/local/lib/python2.7/test/test_asynchat.pyRzs	cCstjtttttƒdS(N(Rtrun_unittestR;RdRfRvRz(tverbose((s./usr/local/lib/python2.7/test/test_asynchat.pyt	test_main)st__main__R…(RkRER%RRtunittestR4ttestRRtImportErrorRR*RRRR&R$R:t
skipUnlesstTestCaseR;RdRfRvRzR†R"Re(((s./usr/local/lib/python2.7/test/test_asynchat.pyt<module>s4

	.
‡

Zerion Mini Shell 1.0