%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_poplib.pyc


Nac@sdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZejdZdZdZd	ejfd
YZdejejfdYZd
e	fdYZeZeedrcddlZeZejjejj e!pAej"dZ#defdYZ$ne
edZ%e%defdYZ&de	fdYZ'dZ(e)dkre(ndS(sTest script for poplib module.iN(tTestCaset
skipUnless(ttest_support(tHOSTt	threadings1 1
2 2
3 3
4 4
5 5
.
stFrom: postmaster@python.org
Content-Type: text/plain
MIME-Version: 1.0
Subject: Dummy

line1
line2
line3
.
tDummyPOP3HandlercBseZdZdZdZdZdZdZdZdZ	dZ
d	ZeZd
Z
e
ZdZdZd
ZRS(cCs:tjj|||jdg|_|jddS(Ns
s+OK dummy pop3 server ready.(tasynchatt
async_chatt__init__tset_terminatort	in_buffertpush(tselftconn((s,/usr/local/lib/python2.7/test/test_poplib.pyR#s
	cCs|jj|dS(N(R
tappend(Rtdata((s,/usr/local/lib/python2.7/test/test_poplib.pytcollect_incoming_data)scCsdj|j}g|_|jddj}|jd}|dkr`||d}nd}t|d|rt|d|}||n|jd|dS(Ntt iiitcmd_s$-ERR unrecognized POP3 command "%s".(tjoinR
tsplittlowertfindthasattrtgetattrR(Rtlinetcmdtspacetargtmethod((s,/usr/local/lib/python2.7/test/test_poplib.pytfound_terminator,s	
cCsdS(N((R((s,/usr/local/lib/python2.7/test/test_poplib.pythandle_error;scCstjj||ddS(Ns
(RRR(RR((s,/usr/local/lib/python2.7/test/test_poplib.pyR>scCs|j|dS(N(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_echoAscCs-|dkr|jdn|jddS(Ntguidos-ERR no such users+OK password required(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_userEscCs-|dkr|jdn|jddS(Ntpythons-ERR wrong passwords+OK 10 messages(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_passJscCs|jddS(Ns
+OK 10 100(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_statOscCsD|r |jd||fn |jdtjj|tdS(Ns	+OK %s %ss+OK(RRRt	LIST_RESP(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_listRs
cCs.|jdtttjj|tdS(Ns+OK %s bytes(Rtlent	RETR_RESPRR(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_retr[scCs|jddS(Ns +OK message marked for deletion.(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_deleascCs|jddS(Ns+OK done nothing.(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_noopdscCs|jddS(Ns+OK done nothing.(R(RR((s,/usr/local/lib/python2.7/test/test_poplib.pytcmd_rpopgs(t__name__t
__module__RRRR RR!R#R%R&R(tcmd_uidlR+tcmd_topR,R-R.(((s,/usr/local/lib/python2.7/test/test_poplib.pyR!s 													tDummyPOP3ServercBsbeZeZejdZdZdZdZ	dZ
dZeZdZ
dZRS(cCstjj|tjj||j|tj|j||j	dt
|_tj|_
|jjd \|_|_dS(Nii(RtThreadRtasyncoret
dispatchert
create_sockettsockettSOCK_STREAMtbindtlistentFalsetactivetLocktactive_locktgetsocknamethosttport(Rtaddresstaf((s,/usr/local/lib/python2.7/test/test_poplib.pyRos

	cCs@|jsttj|_tjj||jjdS(N(R=tAssertionErrorRtEventt_DummyPOP3Server__flagR4tstarttwait(R((s,/usr/local/lib/python2.7/test/test_poplib.pyRHyscCsst|_|jjxF|jr^tjr^|jjtjdddd|jj	qWtj
dtdS(Nttimeoutg?tcountit
ignore_all(tTrueR=RGtsetR5t
socket_mapR?tacquiretlooptreleaset	close_all(R((s,/usr/local/lib/python2.7/test/test_poplib.pytruns	

cCs&|jstt|_|jdS(N(R=RER<R(R((s,/usr/local/lib/python2.7/test/test_poplib.pytstops	cCs2|j\}}|j||_|jdS(N(tacceptthandlertclose(RR
taddr((s,/usr/local/lib/python2.7/test/test_poplib.pyt
handle_acceptscCs|jdS(N(RX(R((s,/usr/local/lib/python2.7/test/test_poplib.pythandle_connectscCsdS(Ni((R((s,/usr/local/lib/python2.7/test/test_poplib.pytwritablescCsdS(N((R((s,/usr/local/lib/python2.7/test/test_poplib.pyR s(R/R0RRWR8tAF_INETRRHRTRURZR[thandle_readR\R (((s,/usr/local/lib/python2.7/test/test_poplib.pyR3ks
							t
TestPOP3ClasscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZRS(cCs|j|jddS(Ns+OK(t
assertTruet
startswith(Rtresp((s,/usr/local/lib/python2.7/test/test_poplib.pytassertOKscCsGttdf|_|jjtj|jj|jj|_dS(Ni(	R3RtserverRHtpoplibtPOP3RARBtclient(R((s,/usr/local/lib/python2.7/test/test_poplib.pytsetUps
cCs|jj|jjdS(N(RgtquitRdRU(R((s,/usr/local/lib/python2.7/test/test_poplib.pyttearDowns
cCs|j|jjddS(Ns+OK dummy pop3 server ready.(tassertEqualRgt
getwelcome(R((s,/usr/local/lib/python2.7/test/test_poplib.pyttest_getwelcomescCs |jtj|jjddS(Ns	echo -err(tassertRaisesReterror_protoRgt	_shortcmd(R((s,/usr/local/lib/python2.7/test/test_poplib.pyttest_exceptionsscCs9|j|jjd|jtj|jjddS(NR"tinvalid(RcRgtuserRnReRo(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_userscCs9|j|jjd|jtj|jjddS(NR$Rr(RcRgtpass_RnReRoRs(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt
test_pass_scCs|j|jjddS(Ni
id(i
id(RkRgtstat(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_statscCsX|j|jjddddddgdf|j|jjdjd	dS(
Nis1 1s2 2s3 3s4 4s5 5it1sOK 1 1(RkRgtlistR`tendswith(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_listsc	CsGddddddddd	gd
f}|j|jjd|dS(Ns
+OK 116 bytessFrom: postmaster@python.orgsContent-Type: text/plainsMIME-Version: 1.0sSubject: DummyRtline1tline2tline3iqtfoo(RkRgtretr(Rtexpected((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_retrs	cCs/|jtj|jjdtjdddS(Nsecho +%si
ta(RnReRoRgRpt_MAXLINE(R((s,/usr/local/lib/python2.7/test/test_poplib.pyttest_too_long_linesscCs|j|jjddS(NR(RcRgtdele(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_delescCs|j|jjdS(N(RcRgtnoop(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_noopscCs|j|jjddS(NR(RcRgtrpop(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_rpopsc	CsPddd}tj|jd|$|jtj|jjddWdQXdS(Ns+OKt<i@BtwelcomeRtkb(Rt	swap_attrRgRnReRotapop(Rtevil_welcome((s,/usr/local/lib/python2.7/test/test_poplib.pyttest_apop_REDOSsc	CsJddddddddd	gd
f}|j|jjdd|dS(Ns
+OK 116 bytessFrom: postmaster@python.orgsContent-Type: text/plainsMIME-Version: 1.0sSubject: DummyRR}R~Riqi(RkRgttop(RR((s,/usr/local/lib/python2.7/test/test_poplib.pyttest_tops		cCs!|jj|jjddS(NR(Rgtuidl(R((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_uidls
(R/R0RcRhRjRmRqRtRvRxR|RRRRRRRR(((s,/usr/local/lib/python2.7/test/test_poplib.pyR_s"															
	tPOP3_SSLskeycert.pemtDummyPOP3_SSLHandlercBs#eZdZdZdZRS(cCsttjj||tj|jdtdtdt|_t|_	|j
|jdg|_|j
ddS(Ntcertfiletserver_sidetdo_handshake_on_connects
s+OK dummy pop3 server ready.(RRRtssltwrap_socketR8tCERTFILERMR<t_ssl_acceptingt_do_ssl_handshakeR	R
R(RR
((s,/usr/local/lib/python2.7/test/test_poplib.pyRs	

	cCsy|jjWntjk
ro}|jdtjtjfkrIdS|jdtjkri|jSn?tj	k
r}|jdt
jkr|jSn
Xt|_
dS(Ni(R8tdo_handshakeRtSSLErrortargstSSL_ERROR_WANT_READtSSL_ERROR_WANT_WRITEt
SSL_ERROR_EOFthandle_closeterrorterrnotECONNABORTEDR<R(Rterr((s,/usr/local/lib/python2.7/test/test_poplib.pyRs
cCs'|jr|jn
tj|dS(N(RRRR^(R((s,/usr/local/lib/python2.7/test/test_poplib.pyR^s	
(R/R0RRR^(((s,/usr/local/lib/python2.7/test/test_poplib.pyRs		sSSL not supportedtTestPOP3_SSLClasscBseZdZdZRS(cCsSttdf|_t|j_|jjtj|jj|jj	|_
dS(Ni(R3RRdRRWRHReRRARBRg(R((s,/usr/local/lib/python2.7/test/test_poplib.pyRhs
cCs|jdtjdS(NR(tassertInRet__all__(R((s,/usr/local/lib/python2.7/test/test_poplib.pyttest__all__$s(R/R0RhR(((s,/usr/local/lib/python2.7/test/test_poplib.pyRs	tTestTimeoutscBs>eZdZdZdZdZdZdZRS(cCstj|_tjtjtj|_|jjdtj	|j|_
tjd|jd|j|jf|_
|j
jt|j
j|jjdS(Ni<ttargetR(RRFtevtR8R]R9tsockt
settimeoutRt	bind_portRBR4Rdtthreadt	setDaemonRMRHRI(R((s,/usr/local/lib/python2.7/test/test_poplib.pyRh*s*
cCs|jj|`dS(N(RR(R((s,/usr/local/lib/python2.7/test/test_poplib.pyRj4s
cCsq|jd|jzHy-|j\}}|jd|jWntjk
r]nXWd|jXdS(Nis
+ Hola mundo
(R;RNRVtsendRXR8RJ(RRtservR
RY((s,/usr/local/lib/python2.7/test/test_poplib.pyRd8s


cCst|jtjtjdztjt|j}WdtjdX|j	|j
jd|j
jdS(Ni(
tassertIsNoneR8tgetdefaulttimeouttsetdefaulttimeoutReRfRRBtNoneRkRt
gettimeoutRX(Rtpop((s,/usr/local/lib/python2.7/test/test_poplib.pyttestTimeoutDefaultDs
cCsw|jtjtjdztjt|jdd}WdtjdX|j|j	j
|j	jdS(NiRJ(RR8RRReRfRRBRRRRX(RR((s,/usr/local/lib/python2.7/test/test_poplib.pyttestTimeoutNoneNs
cCsEtjt|jdd}|j|jjd|jjdS(NRJi(ReRfRRBRkRRRX(RR((s,/usr/local/lib/python2.7/test/test_poplib.pyttestTimeoutValueXs(R/R0RhRjRdRRR(((s,/usr/local/lib/python2.7/test/test_poplib.pyR(s	
			
	
cCsAtttg}tj}ztj|Wdtj|XdS(N(R_RRRtthreading_setuptrun_unittesttthreading_cleanup(tteststthread_info((s,/usr/local/lib/python2.7/test/test_poplib.pyt	test_main^s	t__main__(*t__doc__ReR5RR8tosttimeRtunittestRRttestRttest.test_supportRt
import_moduleRR'R*RRR6R4R3R_R<tSUPPORTS_SSLRRRMtpathRtdirnamet__file__tcurdirRRtrequires_sslRRRR/(((s,/usr/local/lib/python2.7/test/test_poplib.pyt<module>s:	J2P*$
6	


Zerion Mini Shell 1.0