config root man

Current Path : /usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/test/test_socket.pyo

hRc@sddkZddklZddkZddkZddkZddkZddkZddkZddk	Z	ddk
Z
ddklZddk
Z
dadZdZdeifdYZd	eifd
YZdfdYZd
eefdYZdeefdYZdefdYZdeiefdYZdeifdYZdefdYZdefdYZdefdYZdefdYZdefd YZd!efd"YZd#efd$YZ d%efd&YZ!d'efd(YZ"d)eifd*YZ#d+efd,YZ$d-efd.YZ%d/eifd0YZ&d1eifd2YZ'd3efd4YZ(d5Z)e*d6joe)ndS(7iN(ttest_support(tproxyiWt	localhostsMichael Gilfix was here
t
SocketTCPTestcBseZdZdZRS(cCsctititi|_|iititidti|it	t
a
|iiddS(Ni(tsockettAF_INETtSOCK_STREAMtservt
setsockoptt
SOL_SOCKETtSO_REUSEADDRRt	bind_porttHOSTtPORTtlisten(tself((s,/usr/local/lib/python2.5/test/test_socket.pytsetUpscCs|iid|_dS(N(RtclosetNone(R((s,/usr/local/lib/python2.5/test/test_socket.pyttearDowns
(t__name__t
__module__RR(((s,/usr/local/lib/python2.5/test/test_socket.pyRs	t
SocketUDPTestcBseZdZdZRS(cCsStititi|_|iititidti|it	t
a
dS(Ni(RRt
SOCK_DGRAMRRR	R
RRRR
(R((s,/usr/local/lib/python2.5/test/test_socket.pyR#scCs|iid|_dS(N(RRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyR)s
(RRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR!s	tThreadableTestcBsMeZdZdZdZdZdZdZdZdZ	RS(sThreadable Test class

    The ThreadableTest class makes it easy to create a threaded
    client/server pair from an existing unit test. To create a
    new threaded class from an existing unit test, use multiple
    inheritance:

        class NewClass (OldClass, ThreadableTest):
            pass

    This class defines two new fixture functions with obvious
    purposes for overriding:

        clientSetUp ()
        clientTearDown ()

    Any new test functions within the class must then define
    tests in pairs, where the test name is preceeded with a
    '_' to indicate the client portion of the test. Ex:

        def testFoo(self):
            # Server portion

        def _testFoo(self):
            # Client portion

    Any exceptions raised by the clients during their tests
    are caught and transferred to the main thread to alert
    the testing framework.

    Note, the server setup function cannot call any blocking
    functions that rely on the client thread during setup,
    unless serverExplicityReady() is called just before
    the blocking call (such as in setting up a client/server
    connection and performing the accept() in setUp().
    cCs4|i|_|i|_|i|_|i|_dS(N(Rt_ThreadableTest__setUpRt_ThreadableTest__tearDownt_setUpt	_tearDown(R((s,/usr/local/lib/python2.5/test/test_socket.pyt__init__SscCs|iidS(sThis method allows the server to explicitly indicate that
        it wants the client thread to proceed. This is useful if the
        server is about to execute a blocking routine that is
        dependent upon the client thread during its setup routine.N(tserver_readytset(R((s,/usr/local/lib/python2.5/test/test_socket.pytserverExplicitReadyZscCsti|_ti|_ti|_tid|_|i}|id}||d}t	|d|}t
i|i|f|_
|i|iip|iin|iidS(Nit.t_(t	threadingtEventRtclient_readytdonetQueuetqueuetidtrfindtgetattrtthreadtstart_new_threadt	clientRunt
client_threadRtisSetRtwait(Rt
methodnametittest_method((s,/usr/local/lib/python2.5/test/test_socket.pyRas
cCsK|i|ii|iip |ii}|i|ndS(N(RR&R1R(temptytgettfail(Rtmsg((s,/usr/local/lib/python2.5/test/test_socket.pyRts


cCs|ii|ii|it|p
tdny|Wn%tj
o}|ii	|nX|i
dS(Ns%test_func must be a callable function(RR1R%RtclientSetUptcallablet	TypeErrort	ExceptionR(tputtclientTearDown(Rt	test_functstrerror((s,/usr/local/lib/python2.5/test/test_socket.pyR.|s




cCs
tddS(Ns clientSetUp must be implemented.(tNotImplementedError(R((s,/usr/local/lib/python2.5/test/test_socket.pyR9scCs|iitidS(N(R&RR,texit(R((s,/usr/local/lib/python2.5/test/test_socket.pyR>s
(
RRt__doc__RR RRR.R9R>(((s,/usr/local/lib/python2.5/test/test_socket.pyR-s$						tThreadedTCPSocketTestcBs&eZddZdZdZRS(trunTestcCs$ti|d|ti|dS(Nt
methodName(RRR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCstititi|_dS(N(RRRtcli(R((s,/usr/local/lib/python2.5/test/test_socket.pyR9scCs'|iid|_ti|dS(N(RGRRRR>(R((s,/usr/local/lib/python2.5/test/test_socket.pyR>s
	(RRRR9R>(((s,/usr/local/lib/python2.5/test/test_socket.pyRDs	tThreadedUDPSocketTestcBseZddZdZRS(REcCs$ti|d|ti|dS(NRF(RRR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCstititi|_dS(N(RRRRG(R((s,/usr/local/lib/python2.5/test/test_socket.pyR9s(RRRR9(((s,/usr/local/lib/python2.5/test/test_socket.pyRHstSocketConnectedTestcBs8eZddZdZdZdZdZRS(REcCsti|d|dS(NRF(RDR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCs9ti||i|ii\}}||_dS(N(RDRR Rtaccepttcli_conn(Rtconntaddr((s,/usr/local/lib/python2.5/test/test_socket.pyRs

cCs'|iid|_ti|dS(N(RKRRRDR(R((s,/usr/local/lib/python2.5/test/test_socket.pyRs
	cCs3ti||iittf|i|_dS(N(RDR9RGtconnectRR
t	serv_conn(R((s,/usr/local/lib/python2.5/test/test_socket.pyR9s
cCs'|iid|_ti|dS(N(RORRRDR>(R((s,/usr/local/lib/python2.5/test/test_socket.pyR>s
	(RRRRRR9R>(((s,/usr/local/lib/python2.5/test/test_socket.pyRIs
			tSocketPairTestcBs8eZddZdZdZdZdZRS(REcCs'tii|d|ti|dS(NRF(tunittesttTestCaseRR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCsti\|_|_dS(N(Rt
socketpairRRG(R((s,/usr/local/lib/python2.5/test/test_socket.pyRscCs|iid|_dS(N(RRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyRs
cCsdS(N((R((s,/usr/local/lib/python2.5/test/test_socket.pyR9scCs'|iid|_ti|dS(N(RGRRRR>(R((s,/usr/local/lib/python2.5/test/test_socket.pyR>s
	(RRRRRR9R>(((s,/usr/local/lib/python2.5/test/test_socket.pyRPs
			tGeneralModuleTestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZRS(cCstititi}t|}|i|i|i|id}y|iWntj
onX|i	ddS(NsSocket proxy still exists(
RRRRtassertEqualtfilenoRRtReferenceErrorR7(Rtstp((s,/usr/local/lib/python2.5/test/test_socket.pyttest_weakrefs
cCsad}d}d}|iti|d|iti|d|iti|ddS(Nc_s
tidS(N(Rterror(targstkwargs((s,/usr/local/lib/python2.5/test/test_socket.pytraise_errorsc_s
tidS(N(Rtherror(R\R]((s,/usr/local/lib/python2.5/test/test_socket.pytraise_herrorsc_s
tidS(N(Rtgaierror(R\R]((s,/usr/local/lib/python2.5/test/test_socket.pytraise_gaierrorssError raising socket exception.(tfailUnlessRaisesRR[(RR^R`Rb((s,/usr/local/lib/python2.5/test/test_socket.pyttestSocketErrors			cCs<titititititititidS(N(	RRRRtSOCK_RAWtSOCK_RDMtSOCK_SEQPACKETR	R
(R((s,/usr/local/lib/python2.5/test/test_socket.pyttestCrucialConstantsscCsti}yti|}Wntij
odSnX|i|iddjdyti|\}}}Wntij
odSnX||g|}ti|}||jo!|id|t	|fndS(NR!isError resolving host to ip.s=Error testing host resolution mechanisms. (fqdn: %s, all: %s)(
Rtgethostnamet
gethostbynameR[tassert_tfindt
gethostbyaddrtgetfqdnR7trepr(Rthostnametipthnametaliasestipaddrstall_host_namestfqhn((s,/usr/local/lib/python2.5/test/test_socket.pyttestHostnameRess		
cCsddk}t|dody#|it}titdWqtj
o.|it|jo|idq|qXndS(Nitgetrefcountis$socket.getnameinfo loses a reference(tsysthasattrRxRRtgetnameinfotSystemErrorR7(RRytorig((s,/usr/local/lib/python2.5/test/test_socket.pyttestRefCountGetNameInfoscCs1ytiddWntij
onXdS(Ntxi(Riii(RR{R[(R((s,/usr/local/lib/python2.5/test/test_socket.pyttestInterpreterCrash#scCshdti<dti<dti<dti<}x|iD]\}}d|>d}xKddddddd	fD].}|i||@||||@|@qyW||}|i||@||it|dqCWdS(
Ni iliiiiigE#i2Tvi"il(	RthtonltntohlthtonstntohstitemsRUtassertRaisest
OverflowError(RtsizestfunctsizetmaskR3tswapped((s,/usr/local/lib/python2.5/test/test_socket.pyttestNtoH+s
,c	Cs.|i}tidjo
d}nd}xG|D]6}yti|d}PWq0tij
oq0Xq0Wtiti|}|||yti|d
}Wntij
o
d}nX||||ti|||ti|d||dj	o|ti|d
|ndS(Ntlinux2tfreebsd4tfreebsd5tfreebsd6tfreebsd7tfreebsd8tdarwintdaytimetqotdtdomaintechottcptudp(RRRRRRsdarwin(RRR(RRR(RURytplatformRt
getservbynameR[Rt
getservbyport(Rteqtservicestservicetporttport2tudpport((s,/usr/local/lib/python2.5/test/test_socket.pyt
testGetServBy9s0	

		


cCs|itidti}|i|id|itid|itidti}|i|id|itid|itidti}|i|id|i|ittid|it	tiddS(Ni
itspam(
RURtgetdefaulttimeoutRt
gettimeoutRtsetdefaulttimeoutRt
ValueErrorR;(RRX((s,/usr/local/lib/python2.5/test/test_socket.pyttestDefaultTimeout]s 




csttdpdSnddkl}llfd}|id|d|id|d|id	|d
|id|d|id
|d|id|d|id|d|id	|d
|id
|ddS(Nt	inet_ptoni(t	inet_atonRRcs
|S(((ta(RR(s,/usr/local/lib/python2.5/test/test_socket.pyt<lambda>}sts0.0.0.0ss255.0.255.0ss170.170.170.170ss1.2.3.4ss255.255.255.255(RzRRRRtassertEquals(Rtftg((RRs,/usr/local/lib/python2.5/test/test_socket.pyttestIPv4toStringysc	sttdpdSny/ddklll}|pdSnWntj
odSnXfd}|id|d|id|d|id	d|d|id|d
dS(NRi(RtAF_INET6thas_ipv6cs
|S(((R(RR(s,/usr/local/lib/python2.5/test/test_socket.pyRstis::s0::0tis1::sEvV$s$45ef:76cb:1a:56ef:afeb:bac:1924:aeaetRt(RzRRRRtImportErrorR(RRR((RRs,/usr/local/lib/python2.5/test/test_socket.pyttestIPv6toStrings	csttdpdSnddkl}llfd}|id|d|id|d|id	|d
|id|d|id|d|id|d|id	|d
dS(
Nt	inet_ntopi(t	inet_ntoaRRcs
|S(((R(RR(s,/usr/local/lib/python2.5/test/test_socket.pyRss1.0.1.0ss
170.85.170.85sUUs255.255.255.255ss1.2.3.4s(RzRRRRR(RRR((RRs,/usr/local/lib/python2.5/test/test_socket.pyttestStringToIPv4sc
sttdpdSny/ddklll}|pdSnWntj
odSnXfd}|id|d
|id|d|id|ddS(NRi(RRRcs
|S(((R(RR(s,/usr/local/lib/python2.5/test/test_socket.pyRss::Ris::1iss!aef:b01:506:1001:ffff:9997:55:170s
UpRtt(RzRRRRRR(RRR((RRs,/usr/local/lib/python2.5/test/test_socket.pyttestStringToIPv6s	cCstititi}|idtdf|i}titi}|i|dd|fjd|d|i	|dtddS(Ns0.0.0.0iis
%s invalid(
RRRtbindR
tgetsocknameRjRiRkRU(Rtsocktnamet
my_ip_addr((s,/usr/local/lib/python2.5/test/test_socket.pyttestSockNames(cCsJtititi}|ititi}|i|djddS(Nisinitial mode is reuse(RRRt
getsockoptR	R
tfailIf(RRtreuse((s,/usr/local/lib/python2.5/test/test_socket.pyttestGetSockOptscCsctititi}|ititid|ititi}|i|djddS(Niisfailed to set reuse mode(RRRRR	R
RR(RRR((s,/usr/local/lib/python2.5/test/test_socket.pyttestSetSockOptscCsLtititi}|id|i|iti|iddS(NiR(RRRt
settimeoutRRR[tsend(RR((s,/usr/local/lib/python2.5/test/test_socket.pyttestSendAfterCloses

cCsetititi}|i|iti|i|iti|i|id|idS(Ni(RRRRUtfamilyttypetprotoR(RR((s,/usr/local/lib/python2.5/test/test_socket.pyttestNewAttributess
(RRRZRdRhRwR~RRRRRRRRRRRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyRTs$	
							$									tBasicTCPTestcBseZddZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZRS(REcCsti|d|dS(NRF(RIR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCs&|iid}|i|tdS(Ni(RKtrecvRUtMSG(RR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestRecvscCs|iitdS(N(RORR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt	_testRecvscCsL|iittd}|iid}||}|i|tdS(Nii(RKRtlenRRU(Rtseg1tseg2R8((s,/usr/local/lib/python2.5/test/test_socket.pyttestOverFlowRecvs
cCs|iitdS(N(RORR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testOverFlowRecvscCs,|iid\}}|i|tdS(Ni(RKtrecvfromRUR(RR8RM((s,/usr/local/lib/python2.5/test/test_socket.pyttestRecvFromscCs|iitdS(N(RORR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt
_testRecvFromscCsX|iittd\}}|iid\}}||}|i|tdS(Nii(RKRRRRU(RRRMRR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestOverFlowRecvFroms"
cCs|iitdS(N(RORR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testOverFlowRecvFromscCsLd}x+|iid}|pPn||7}q	|i|dddS(NtiRi(RKRRU(RR8tread((s,/usr/local/lib/python2.5/test/test_socket.pyttestSendAlls
cCsdd}|ii|dS(NRi(ROtsendall(Rt	big_chunk((s,/usr/local/lib/python2.5/test/test_socket.pyt_testSendAlls
cCsettdpdSn|ii}ti|titi}|id}|i|t	dS(Ntfromfdi(
RzRRKRVRRRRRUR(RtfdRR8((s,/usr/local/lib/python2.5/test/test_socket.pyt
testFromFd scCs|iitdS(N(RORR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testFromFd)scCs&|iid}|i|tdS(Ni(RKRRUR(RR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestShutdown,scCs$|iit|iiddS(Ni(RORRtshutdown(R((s,/usr/local/lib/python2.5/test/test_socket.pyt
_testShutdown1s(RRRRRRRRRRRRRRRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyRs									
					tBasicUDPTestcBsJeZddZdZdZdZdZdZdZRS(REcCsti|d|dS(NRF(RHR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyR7scCs,|iitt}|i|tdS(N(RRRRRU(RR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestSendtoAndRecv:scCs |iitdttfdS(Ni(RGtsendtoRRR
(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testSendtoAndRecv?scCs2|iitt\}}|i|tdS(N(RRRRRU(RR8RM((s,/usr/local/lib/python2.5/test/test_socket.pyRBscCs |iitdttfdS(Ni(RGRRRR
(R((s,/usr/local/lib/python2.5/test/test_socket.pyRGscCs|it|iiddS(Ni(RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyttestRecvFromNegativeJscCs |iitdttfdS(Ni(RGRRRR
(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testRecvFromNegativeNs(	RRRRRRRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR5s					t
TCPCloserTestcBseZdZdZRS(cCs||ii\}}|i|i}ti|gggd\}}}|i||g|i|idddS(Ng?iR(RRJRRGtselectRUR(RRLRMtsdRtwriteterr((s,/usr/local/lib/python2.5/test/test_socket.pyt	testCloseSs
	$cCs'|iittftiddS(Ng?(RGRNRR
ttimetsleep(R((s,/usr/local/lib/python2.5/test/test_socket.pyt
_testClose\s(RRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyRQs		tBasicSocketPairTestcBs8eZddZdZdZdZdZRS(REcCsti|d|dS(NRF(RPR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRbscCs&|iid}|i|tdS(Ni(RRRUR(RR8((s,/usr/local/lib/python2.5/test/test_socket.pyRescCs|iitdS(N(RGRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyRiscCs|iitdS(N(RRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyttestSendlscCs&|iid}|i|tdS(Ni(RGRRUR(RR8((s,/usr/local/lib/python2.5/test/test_socket.pyt	_testSendos(RRRRRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR`s
			tNonBlockingTCPTestscBs\eZddZdZdZdZdZdZdZdZ	d	Z
RS(
REcCsti|d|dS(NRF(RDR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRuscCsp|iidti}y|iiWntij
onXti}|i||djddS(Nig?s Error setting non-blocking mode.(RtsetblockingRRJRR[Rk(Rtstarttend((s,/usr/local/lib/python2.5/test/test_socket.pyttestSetBlockingxscCsdS(N((R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testSetBlockingscCs|iidy|ii\}}Wntij
onX|idti|iggg\}}}|i|jo|ii\}}n|iddS(Nis'Error trying to do non-blocking accept.s'Error trying to do accept after select.(RRRJRR[R7R(RRLRMRRR((s,/usr/local/lib/python2.5/test/test_socket.pyt
testAccepts
$cCs'tid|iittfdS(Ng?(RRRGRNRR
(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testAccepts
cCs|ii\}}dS(N(RRJ(RRLRM((s,/usr/local/lib/python2.5/test/test_socket.pyttestConnectscCs*|iid|iittfdS(Ni
(RGRRNRR
(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testConnectscCs|ii\}}|idy|itt}Wntij
onX|idt	i	|ggg\}}}||jo)|itt}|i
|tn|iddS(Nis%Error trying to do non-blocking recv.s0Error during select call to non-blocking socket.(RRJRRRRRR[R7RRU(RRLRMR8RRR((s,/usr/local/lib/python2.5/test/test_socket.pyRs

!
cCs7|iittftid|iitdS(Ng?(RGRNRR
RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyRs
(RRRRRRR	R
RRR(((s,/usr/local/lib/python2.5/test/test_socket.pyRss							tFileObjectClassTestCasecBseZdZddZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZRS(iREcCsti|d|dS(NRF(RIR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCs,ti||iid|i|_dS(Ntrb(RIRRKtmakefiletbufsizet	serv_file(R((s,/usr/local/lib/python2.5/test/test_socket.pyRs
cCs:|ii|i|iid|_ti|dS(N(RRRktclosedRRIR(R((s,/usr/local/lib/python2.5/test/test_socket.pyRs
	cCs&ti||iid|_dS(Ntwb(RIR9RORtcli_file(R((s,/usr/local/lib/python2.5/test/test_socket.pyR9s
cCs:|ii|i|iid|_ti|dS(N(RRRkRRRIR>(R((s,/usr/local/lib/python2.5/test/test_socket.pyR>s
	cCsL|iittd}|iid}||}|i|tdS(Ni(RRRRRU(Rt	first_segt
second_segR8((s,/usr/local/lib/python2.5/test/test_socket.pyt
testSmallReads
cCs!|iit|iidS(N(RRRtflush(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testSmallReadscCs#|ii}|i|tdS(N(RRRUR(RR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestFullReadscCs!|iit|iidS(N(RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt
_testFullReadscCsHd}x+|iid}|pPn||7}q	|i|tdS(NRi(RRRUR(Rtbuftchar((s,/usr/local/lib/python2.5/test/test_socket.pyttestUnbufferedReads
cCs!|iit|iidS(N(RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testUnbufferedReadscCs#|ii}|i|tdS(N(RtreadlineRUR(Rtline((s,/usr/local/lib/python2.5/test/test_socket.pyttestReadlinescCs!|iit|iidS(N(RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt
_testReadlinescCs|iitd}|id||iitd}|id||ii}|id||ii}|id||ii}|it|dS(Ns
A baloo iss a bears
sA BALOO IS A BEAR.
(RRRRURR(Rt
a_baloo_ist_a_bearR ((s,/usr/local/lib/python2.5/test/test_socket.pyttestReadlineAfterReadscCsA|iid|iid|iit|iidS(NsA baloo is a bear
sA BALOO IS A BEAR.
(RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testReadlineAfterRead	scCsK|iitd}|id||ii}|id|dS(NsEnd Of tLine(RRRRUR(Rtend_of_R ((s,/usr/local/lib/python2.5/test/test_socket.pyttestReadlineAfterReadNoNewlinescCs|iiddS(NsEnd Of Line(RR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testReadlineAfterReadNoNewlinescCs|i|iidS(N(RkRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyttestClosedAttrscCs|i|iidS(N(RkRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testClosedAttrs(RRRRRRR9R>RRRRRRR!R"R%R&R)R*R+R,(((s,/usr/local/lib/python2.5/test/test_socket.pyRs(									
								t!UnbufferedFileObjectClassTestCasecBs&eZdZdZdZdZRS(sRepeat the tests from FileObjectClassTestCase with bufsize==0.

    In this case (and in this case only), it should be possible to
    create a file object, read a line from it, create another file
    object, read another line from it, without loss of data in the
    first file object's buffer.  Note that httplib relies on this
    when reading multiple requests from the same socket.icCsb|ii}|i|dt|iidd|_|ii}|i|dtdS(NsA. R
isB. (RRRURRKR(RR ((s,/usr/local/lib/python2.5/test/test_socket.pyttestUnbufferedReadline*s
cCs9|iidt|iidt|iidS(NsA. sB. (RRRR(R((s,/usr/local/lib/python2.5/test/test_socket.pyt_testUnbufferedReadline2s(RRRCRR.R/(((s,/usr/local/lib/python2.5/test/test_socket.pyR-s	t#LineBufferedFileObjectClassTestCasecBseZdZRS(i(RRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR07st$SmallBufferedFileObjectClassTestCasecBseZdZRS(i(RRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR1<stUrllib2FileobjectTestcBseZdZRS(cCsdddY}|}ti|}|i|i|i|}ti|dt}|i|i|idS(Nt
MockSocketcBs eZeZdZdZRS(cSsdS(N((R((s,/usr/local/lib/python2.5/test/test_socket.pyRIscSs
t|_dS(N(tTrueR(R((s,/usr/local/lib/python2.5/test/test_socket.pyRJs(RRtFalseRRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR3Gs	R((Rt_fileobjectRRkRR4(RR3RXR((s,/usr/local/lib/python2.5/test/test_socket.pyRFs	
	
(RRR(((s,/usr/local/lib/python2.5/test/test_socket.pyR2AstTCPTimeoutTestcBs#eZdZdZdZRS(cs)fd}iti|ddS(Ncs!iidiidS(Ng?(RRRJ(R\R](R(s,/usr/local/lib/python2.5/test/test_socket.pyt
raise_timeout\ss*Error generating a timeout exception (TCP)(RcRttimeout(RR8((Rs,/usr/local/lib/python2.5/test/test_socket.pyttestTCPTimeout[scCst}y#|iid|ii}WnQtij
o|idn0tij
o
t}n|idnX|p|idndS(Ngs%caught timeout instead of error (TCP)s!caught unexpected exception (TCP)s3accept() returned success when we did not expect it(	R5RRRJRR9R7R[R4(Rtoktfoo((s,/usr/local/lib/python2.5/test/test_socket.pyttestTimeoutZerobs
cs-ttdpdSn|iiddtfdYfd}titi|}zytidy|ii}WnHti	j
o|i
dn4j
on"|i
dnX|i
d	tid
Wn j
o|i
dnXWdtiti|XdS(Ntalarmg@tAlarmcBseZRS((RR(((s,/usr/local/lib/python2.5/test/test_socket.pyR?wscs
dS(N((tsignaltframe(R?(s,/usr/local/lib/python2.5/test/test_socket.pyt
alarm_handlerysiscaught timeout instead of Alarms'caught other exception instead of Alarmsnothing caughtisgot Alarm in wrong place(RzR@RRR<tSIGALRMR>RJRR9R7(RRBt	old_alarmR<((R?s,/usr/local/lib/python2.5/test/test_socket.pyttestInterruptedTimeoutps,

(RRR:R=RE(((s,/usr/local/lib/python2.5/test/test_socket.pyR7Ys		tUDPTimeoutTestcBseZdZdZRS(cs)fd}iti|ddS(Ncs$iidiiddS(Ng?i(RRR(R\R](R(s,/usr/local/lib/python2.5/test/test_socket.pyR8ss*Error generating a timeout exception (UDP)(RcRR9(RR8((Rs,/usr/local/lib/python2.5/test/test_socket.pyttestUDPTimeoutscCst}y&|iid|iid}WnQtij
o|idn0tij
o
t}n|idnX|p|idndS(Ngis%caught timeout instead of error (UDP)s!caught unexpected exception (UDP)s1recv() returned success when we did not expect it(	R5RRRRR9R7R[R4(RR;R<((s,/usr/local/lib/python2.5/test/test_socket.pyR=s
(RRRGR=(((s,/usr/local/lib/python2.5/test/test_socket.pyRFs	tTestExceptionscBseZdZRS(cCsq|ittit|ittiti|ittiti|ittitidS(N(Rkt
issubclassRR[R<R_RaR9(R((s,/usr/local/lib/python2.5/test/test_socket.pyttestExceptionTrees(RRRJ(((s,/usr/local/lib/python2.5/test/test_socket.pyRHstTestLinuxAbstractNamespacecBs)eZdZdZdZdZRS(ilcCsd}tititi}|i||idtititi}|i|i|i|i|i||i|i	|dS(Ntpython-test-helloi(
RtAF_UNIXRRRRNRRJRUtgetpeername(Rtaddressts1ts2((s,/usr/local/lib/python2.5/test/test_socket.pyttestLinuxAbstractNamespaces


cCsTdd|id}tititi}|i||i|i|dS(NRthi(t
UNIX_PATH_MAXRRMRRRUR(RRORX((s,/usr/local/lib/python2.5/test/test_socket.pyttestMaxNames
cCsFdd|i}tititi}|iti|i|dS(NRRS(RTRRMRRR[R(RRORX((s,/usr/local/lib/python2.5/test/test_socket.pyttestNameOverflows(RRRTRRRURV(((s,/usr/local/lib/python2.5/test/test_socket.pyRKs		tBufferIOTestcBs>eZdZddZdZdZdZdZRS(sF
    Test the buffer versions of socket.recv() and socket.send().
    REcCsti|d|dS(NRF(RIR(RRF((s,/usr/local/lib/python2.5/test/test_socket.pyRscCshtiddd}|ii|}|i|tt|itt }|i|tdS(Ntct i(tarrayRKt	recv_intoRURRttostring(RRtnbytesR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestRecvIntos
cCs tt}|ii|dS(N(tbufferRROR(RR((s,/usr/local/lib/python2.5/test/test_socket.pyt
_testRecvIntoscCsntiddd}|ii|\}}|i|tt|itt }|i|tdS(NRXRYi(RZRKt
recvfrom_intoRURRR\(RRR]RMR8((s,/usr/local/lib/python2.5/test/test_socket.pyttestRecvFromIntos
cCs tt}|ii|dS(N(R_RROR(RR((s,/usr/local/lib/python2.5/test/test_socket.pyt_testRecvFromIntos(RRRCRR^R`RbRc(((s,/usr/local/lib/python2.5/test/test_socket.pyRWs			cCsttttttg}tidjo|it	t
gn|ittt
tttgttdo|itntidjo|itnti}ti|ti|dS(NtmacRSR(RTRRR7RHRWRyRtextendRRFRRR-R0R1R2RzRtappendRRKRtthreading_setuptrun_unittesttthreading_cleanup(tteststthread_info((s,/usr/local/lib/python2.5/test/test_socket.pyt	test_mains$

t__main__(+RQttestRRRRR,R#R'RyRZtweakrefRR@R
RRRRRRRRDRHRIRPRTRRRRRRR-R0R1R2R7RFRHRKRWRlR(((s,/usr/local/lib/python2.5/test/test_socket.pys<module>sP
b	LDg6	


Man Man