%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_xmlrpc.pyo


Nac@s;ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZyddlZWnek
rdZnXyddlZWnek
rdZnXi
dd6dd6dOd	6d
d6dgd
6ejdd6ejd6ejdd6ejdPd6ejejddddddd6gZejredjiejdd6dejd6nd ejfd!YZd"ejfd#YZd$ejfd%YZd&ejfd'YZd(ejfd)YZda a!a"ddd*Z#dd+Z$d,Z%ej&ed-d.ejfd/YZ'd0e'fd1YZ(d2e'fd3YZ)d4e'fd5YZ*d6e'fd7YZ+d8e+fd9YZ,d:e+fd;YZ-ej&ed<d=e'fd>YZ.d?ejfd@YZ/dAej0fdBYZ1ej&ed-dCejfdDYZ2dEejfdFYZ3dGdQdHYZ4dIej5fdJYZ6dKejfdLYZ7ej8dMZ9e:dNkr7e9ndS(RiN(ttest_supportsfoo@bar.baz.spamtastringgHzns@tafloatiitanintlt
ashortlongs.zyx.41tanotherlistsmy dog has fleastabase64tbooleans20050210T11:41:23t	datetime1ii
ii)iiit	datetime2t	datetime3s\u4000\u6000\u8000tunicodes
regular values
ukey\u4000tXMLRPCTestCasecBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
ejdZejd
ZdZRS(cCs1|jttjtjtfdddS(Ni(tassertEqualtalistt	xmlrpclibtloadstdumps(tself((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_load0s	cCstjdddddd}tj|f}tj|dd\\}}|j|||j|dtj|dd	\\}}|j|tjd
dS(Niii
ii)ituse_datetimeiis20050210T11:41:23(tdatetimeRRRR
tNonetDateTime(Rtdttstnewdttm((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_bare_datetime4scCstjdddddd}tj|f}tj|dd\\}}|j|||j|dtj|dd\\}}|j|tjd	dS(
Niii
ii)iRis00010210T11:41:23(RRRRR
RR(RRRRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_datetime_before_1900BscCstjj}tj|j}|j||k|j||k|tjdd}|j||k|j||kdS(Ntsecondsi(RtnowRRt	timetuplet
assertTruet	timedelta(RRRtthen((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_cmp_datetime_DateTimeMscCsutj}tjtj|fdt\\}}|j|jttj|fdt}|j|tdS(Ntmethodresponse(RRRRtTruetassertIsInstancetvaluetstr(Rtdtnew_dtdummyR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_bug_1164912VscCsldtfdY}|}d|_d|_tjtj|f\\}}|j||jdS(NtTcBseZRS((t__name__t
__module__(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR.asidtHello(tobjecttxtyRRRR
t__dict__(RR.tttt2R,((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_newstyle_class`s			$cCs|jttjddS(Nlicl(l(tassertRaisest
OverflowErrorRR(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_big_longiscCs$|jttjidd6fdS(Niii(iii(R9t	TypeErrorRR(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_bad_dictlscCsKdddg}ddd|g}|j||jttj|fdS(Niiiii(tappendR9R<RR(RtlR6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_recursive_seqos
cCsOidd6dd6}idd6|d6}||d<|jttj|fdS(Nit1t2it3R*R6(R9R<RR(RR*R6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_recursive_dictus
cCs	tjdkr1|jttjtdfntjtjtjf|jttjtjdf|jttjtjdfd}tj	}|j
tj||j
tj||jt|j
tjd||jt|j
tjd|dS(	Nliii"cSsdS(N((R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytdummy_writeslll(tsystmaxintR9R:RRtinttMAXINTtMININTt
Marshallertdump_int(RRER((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_big_int{s  	 cCsptdg}tdgf}tj|dt}|j|tj|dd|jttj|fdS(Nt
allow_nonei(	RRRRR&R
RR9R<(RR(targ1tstrg((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_nones
	cCsitjdtjd6}tj|fdd}d|}|jtj|dd|tj|fdddt}|jtj|dd|tjd}tj|fddd	|}|jtj|dd||jtj|d
|dS(Nsvalue\u20ac\xa4s
key\u20ac\xa4tencodingsiso-8859-15s,<?xml version='1.0' encoding='iso-8859-15'?>iR%smethod\u20ac\xa4t
methodnamei(RtuRRR
RR&(RR(RPRS((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_encodings
!	!	!c	Csd}tj}tjdNddl}|jdztj|\\}}}Wd|j|XWdQX|j}tjr|j	|d|j
|t|j	|d
g|j
|ddt|j
|dd	tn#|j	|d
|j	|dgdS(Ns)<?xml version='1.0' encoding='iso-8859-1'?>
                  <params>
                    <param><value>
                      <string>abc </string>
                      </value></param>
                    <param><value>
                      <struct>
                        <member>
                          <name>def </name>
                          <value><string>ghi </string></value>
                          </member>
                        </struct>
                      </value></param>
                  </params>
                  RFis
iso-8859-1uabc •udef –ughi —iisabc •sdef –sghi —(udef –ughi —(sdef –sghi —(RFtgetdefaultencodingRtCleanImporttsetdefaultencodingRRtitemsthave_unicodeR
R'R(Rtutf8told_encodingttemp_sysRR*RRY((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_default_encoding_issuess"
	cCsatj}d}|j|tj|d}|j|tj|d}|j|tj|dS(Ns6<params><param><value><spam/></value></param></params>sT<params><param><value><array><value><spam/></value></array></value></param></params>s<params><param><value><struct><member><name>a</name><value><spam/></value></member><member><name>b</name><value><spam/></value></member></struct></value></param></params>(Rt
ResponseErrorR9R(RR_tdata((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_loads_unsupporteds	(R/R0RRRR$R-R8R;R=R@RDRMRQRtrequires_unicodeRUR^Ra(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR.s						
								+tHelperTestCasecBseZdZRS(cCsO|jtjdd|jtjdd|jtjdddS(Nsa&bsa&amp;bsa<bsa&lt;bsa>bsa&gt;b(R
Rtescape(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_escapes(R/R0Re(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRcst
FaultTestCasecBseZdZdZRS(cCsHtjdd}|jt|d|jt|t|dS(Ni*s
Test Faults<Fault 42: 'Test Fault'>(RtFaultR
treprR)(Rtf((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt	test_reprscCstjdd}tj|f}tj|\\}}|j|idd6dd6|j|dtjj|}|jtjtj|dS(Ni*s
Test Faultt	faultCodetfaultString(RRgRRR
RRKR9(RRiRtnewfR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dump_faults(R/R0RjRn(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRfs	tDateTimeTestCasecBsGeZdZdZdZdZdZdZdZRS(cCstj}dS(N(RR(RR6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_defaultscCsDd}tj|}|jt|tjdtj|dS(Ngl]ޮAs%Y%m%dT%H:%M:%S(RRR
R)ttimetstrftimet	localtime(RR*R6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt	test_timesc	Cs/d}tj|}|jt|d
dS(Niii	i
i&i2iiis20070609T10:38:50(	iii	i
i&i2iii(RRR
R)(RR*R6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_time_tuplescCsDtjd}tj|}|jt|tjd|dS(Ngl]ޮAs%Y%m%dT%H:%M:%S(RqRsRRR
R)Rr(RR*R6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_time_structscCsGtjdddddd}tj|}|jt|ddS(Niiiiiis20070102T03:04:05(RRRR
R)(RR*R6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_datetime_datetimescCsWtjdddddd}tj|}dt|}|jt||dS(Niiiiiis$<DateTime '20070102T03:04:05' at %x>(RRRtidR
Rh(RR*R6tval((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRjscCsyd}tj}|j|tjtjdddddd}|j||tj|}|j||dS(Ns 20070908T07:11:13  ii	iiii
(RRtdecodeRR
t	_datetime(RR*tt1ttrefR7((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_decodes
'(	R/R0RpRtRuRvRwRjR~(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRos						tBinaryTestCasecBs#eZdZdZdZRS(cCs&tj}|jt|ddS(Nt(RtBinaryR
R)(RR6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRp"scCs/d}tj|}|jt||dS(Nsabc123(RRR
R)(RR*R6((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_string&scCsmd}tj|}tj}|j||jt||tj|}|jt||dS(Nsabc123(tbase64tencodestringRRRzR
R)t_binary(RR*tdeR|R7((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR~+s
(R/R0RpRR~(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR!s		c	CsdddY}d}dtjfdY}|sGtj}n|d|d|d	td
t}zy|jjd|j|jj\aadttfa	|j
|j|j|j
t|j
d
d|j
dtjd|j
||j||jx$|dkrT|j|d8}q1WWntjk
rlnXWd|jjda|jXdS(NtTestInstanceClasscBseZdZdZRS(cSs||S(N((RR3R4((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytdiv=scSs|dkrdSdS(NRsThis is the div function((Rtname((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt_methodHelp@s(R/R0RR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR<s	cSstS(sThis is my function(R&(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytmy_functionDstMyXMLRPCServercBseZdZRS(cSs,|jj\}}|jt||fS(N(tsockettaccepttsetblockingR&(RRtport((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytget_requestIs
(R/R0R(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRHst	localhostiRRtlogRequeststbind_and_activateishttp://%s:%dcSs||S(N((R3R4((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt<lambda>cRtaddcSs|S(N((R3((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRdRst\xea\u0161ti((Ri(tSimpleXMLRPCServertSimpleXMLRPCRequestHandlertFalseRt
settimeouttserver_bindtgetsocknametADDRtPORTtURLtserver_activatet register_introspection_functionstregister_multicall_functionstregister_functiontpowRRTtregister_instancetsetthandle_requestttimeouttcloseR(tevttnumrequeststrequestHandlerRRRRRtserv((s,/usr/local/lib/python2.7/test/test_xmlrpc.pythttp_server;s>	








cCsdddY}d}dtjfdY}|sGtj}nd|fdY}|d|d
tdt}|jjd|jzy|jj\aa	d
tt	fa
|jddg}x:|D]2}	|j|	tj
}
|
j|
jqW|j|d	jt|j|djdd|jx$|d	krz|j|d8}qWWWntjk
rnXWd|jjda	|jXdS(NRcBseZdZdZRS(cSs||S(N((RR3R4((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRwscSs|dkrdSdS(NRsThis is the div function((RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRzs(R/R0RR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRvs	cSstS(sThis is my function(R&(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR~sRcBseZdZRS(cSs,|jj\}}|jt||fS(N(RRRR&(RRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs
(R/R0R(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRstMyRequestHandlercBseZgZRS((R/R0t	rpc_paths(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRsRiRRishttp://%s:%ds/foos/foo/baricSs||S(N((R3R4((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRRR((Ri(RtMultiPathXMLRPCServerRRRRRRRRRRtadd_dispatchertSimpleXMLRPCDispatcherRRtget_dispatcherRRRRRRR(RRRRRRRRtpathstpathR*((s,/usr/local/lib/python2.7/test/test_xmlrpc.pythttp_multi_serverus>	



 


cCsxy8|jdks!|jdkr%tS|jjd}Wntk
rWt|}nX|rtd|jkrttStS(sReturns True if the given ProtocolError is the product of a server-side
       exception caused by the 'temporarily unavailable' response sometimes
       given by operations on non-blocking sockets.isX-exceptionstemporarily unavailableN(	terrcodetheadersRR&tgettAttributeErrorR)tlowerR(tetexc_mess((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytis_unavailable_exceptions
s!Threading required for this test.tBaseServerTestCasecBs2eZdZdZeeZdZdZ	RS(icCssttj_tj|_|j|j|jf}tjd|j	d|j
|jjd|jjdS(Nttargettargsi
(
R&Rt_send_traceback_headert	threadingtEventRt
request_countRtThreadt
threadFunctstarttwaittclear(Rt	serv_args((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytsetUpscCs |jjdttj_dS(Ni
(RRRRR(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttearDownsN(
R/R0RRRtstaticmethodRRRR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs
	
tSimpleServerTestCasecBseZdZejdZejdZejdZejdZdZ	dZ
dZej
ejjdkd	d
ZdZdZd
ZdZdZRS(cCsy/tjt}|j|jdddWnQtjtjfk
r}t|s|j	d|t
|ddfqnXdS(Niis%s
%sRRi(RtServerProxyRR
Rt
ProtocolErrorRterrorRtfailtgetattr(RtpR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_simple1s cCstjd}tjd}y3tjt}|j|j||||WnQtjtj	fk
r}t
|s|jd|t|ddfqnXdS(Ns*P\N{LATIN SMALL LETTER Y WITH CIRCUMFLEX}ts$h\N{LATIN SMALL LETTER O WITH HORN}ns%s
%sRR(
RRTRRRR
RRRRRRR(Rtstart_stringt
end_stringRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt
test_nonasciiscCs9tjdttf}|j|jddddS(Nuhttp://%s:%d/RPC2tauéuaé(RRRRR
R(Rtserver((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_unicode_hostscCstd}td}y9tjtdd}|j|j||||WnQtjtjfk
r}t	|s|j
d|t|ddfqnXdS(Ni iRRsiso-8859-15s%s
%sRR(tunichrRRRR
RRRRRRR(RRRRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_client_encodingscCsy>tjtdd}t|d}|j|ddWnQtjtjfk
r}t|s|j	d|t|ddfqnXdS(NRRsiso-8859-15stti*s%s
%sRR(
RRRRR
RRRRR(RRRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_nonascii_methodnamescCsbtjtt}|jdd|j}|j|j|jd|j|j	ddS(NtPOSTs/this-is-not-validis	Not Found(
thttplibtHTTPConnectionRRtrequesttgetresponseRR
tstatustreason(Rtconntresponse((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytXXXtest_404"s
c
Csyhtjt}|jj}tddddtjddddd	g	}|jt||WnQtj	t
jfk
r}t|s|j
d
|t|ddfqnXdS(
NRRRRst\xea\u0161tssystem.listMethodsssystem.methodHelpssystem.methodSignaturessystem.multicalls%s
%sRR(RRRtsystemtlistMethodsRRRTR
RRRRRR(RRtmethtexpected_methodsR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_introspection1-scCsy5tjt}|jjd}|j|dWnQtjtjfk
r}t	|s|j
d|t|ddfqnXdS(NRsThis is the div functions%s
%sRR(RRRRt
methodHelpR
RRRRRR(RRtdivhelpR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_introspection2<sis)Docstrings are omitted with -O2 and abovecCsy5tjt}|jjd}|j|dWnQtjtjfk
r}t	|s|j
d|t|ddfqnXdS(NRsThis is my functions%s
%sRR(RRRRRR
RRRRRR(RRt
myfunctionR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_introspection3HscCsy5tjt}|jjd}|j|dWnQtjtjfk
r}t	|s|j
d|t|ddfqnXdS(NRssignatures not supporteds%s
%sRR(RRRRtmethodSignatureR
RRRRRR(RRtdivsigR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_introspection4VscCsytjt}tj|}|jdd|jdd|jdd|\}}}|j|d
|j|d|j|dWnQtjt	j
fk
r}t|s|jd|t
|dd	fqnXdS(
Niiiiii*s%s
%sRRiii(RRRt	MultiCallRRRR
RRRRRR(RRt	multicallt
add_resultt
pow_resultt
div_resultR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_multicallcscCsyktjt}tj|}|j|}|j|jddd|j|jdddWnQtjtj	fk
r}t
|s|jd|t|ddfqnXdS(	NiRkiRlsJ<type 'exceptions.Exception'>:method "this_is_not_exists" is not supporteds%s
%sRR(
RRRRtthis_is_not_existsR
tresultsRRRRRR(RRRtresultR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_non_existing_multicallts
	cCs@|jttjtd|jtjtd|jdS(Nt__addttitle(R9RRtresolve_dotted_attributeR)R!R(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_dotted_attributes	cCs7tjtt}|jdttf|jdS(NswPOST /RPC2 HTTP/1.0
Content-Length: 100

bye HTTP/1.1
Host: %s:%s
Accept-Encoding: identity
Content-Length: 0

(RRRRtsendR(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_partial_posts	(R/R0RRRbRRRRRRRtunittesttskipIfRFtflagstoptimizeRRRRRR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs	

			
	
			
tSimpleServerEncodingTestCasecBs/eZedddZejdZRS(cCst|||ddS(Nsiso-8859-15(R(RRRRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRscCstd}td}y3tjt}|j|j||||WnQtjtjfk
r}t	|s|j
d|t|ddfqnXdS(Ni is%s
%sRR(RRRRR
RRRRRRR(RRRRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_server_encodingsN(R/R0RRRRRbR
(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRstMultiPathServerTestCasecBs,eZeeZdZdZdZRS(icCsOtjtd}|j|jddd|jtj|jdddS(Ns/fooiii(RRRR
RR9RgR(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt
test_path1scCsOtjtd}|j|jddd|jtj|jdddS(Ns/foo/bariii(RRRR
RR9RgR(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt
test_path2s(R/R0RRRRRR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs	tBaseKeepaliveServerTestCasecBs0eZdejfdYZeZdZRS(tRequestHandlercBs/eZejZdZgZdZdZRS(sHTTP/1.1cCs6|jjgt|jd|_|jj|S(Ni(t
myRequestsR>tlentreqidxtparentClassthandle(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRscCs0|jj|}|j|jj|j|S(N(Rthandle_one_requestRRR>traw_requestline(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs(	R/R0RRRtprotocol_versionRRR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs
		cCsg|j_tj|S(N(RRRR(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs(R/R0RRRRR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs
tKeepaliveServerTestCase1cBseZdZRS(cCstjt}|j|jddd|j|jddd|j|jddd|jt|jjd|jt|jjdddS(	Niiiiiiii(	RRRR
RRRRtassertGreaterEqual(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_twos(R/R0R(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRstKeepaliveServerTestCase2cBs eZdZdZdZRS(icCs$tjt}|j|jddd|j|jddd|j|jddd	|d|j|jddd
|j|jddd|j|jddd|jt|jjd|jt|jjdd|jt|jjdddS(
NiiRiiiiiiiii(	RRRR
RRRRR(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt
test_closes
 cCswtjt}|j|jddd|dj|j|jddd|jt|jjddS(Niit	transportiii(	RRRR
RRRRR(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_transports
(R/R0RRR!(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs	sgzip not availabletGzipServerTestCasecBsmeZdejfdYZeZdejfdYZdZdZ	dZ
dZdZRS(	RcBs eZejZdZdZRS(sHTTP/1.1cCs)t|jd|j_|jj|S(Nscontent-length(RHRt	__class__tcontent_lengthRtdo_POST(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR%s(R/R0RRRRR%(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs	t	TransportcBs eZeZdZdZRS(cCs.t|jdd|_tjj||S(Nscontent-lengthi(RHt	getheadertresponse_lengthRR&tparse_response(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR)scCs2|jr|jddntjj|||S(NsContent-Encodingtgzip(t	fake_gzipt	putheaderRR&tsend_content(Rt
connectiontbody((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR-s	(R/R0RR+R)R-(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR&s	cCstj|dS(N(RR(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR%scCs|j}d|_tjtd|}|j|jddd|jj	}d|_|j|jddd|jj	}|j
||kdS(NR iiiii(R&Rtencode_thresholdRRRR
RRR$R!(RR6RRtb((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_gzip_request(s		cCsr|j}d|_t|_tjtd|}|jtj	t
jd}||jddWdQXdS(NR s\b400\bii(
R&RR0R&R+RRRtassertRaisesRegexpRtretcompileR(RR6Rtcm((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_bad_gzip_request3s		cCs|j}tjtd|}|jj}d|j_|j|jddd|j	}d|j_|j|jddd|j	}||j_|j
||kdS(NR iiiii(R&RRRRR0RR
RR(R!(RR6RtoldRR1((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_gzip_response=s		cCsd	}d|}tj|}tj|}|jt||d|d}tj|}|jtdtj|WdQXtj|dddS(
Niisis#max gzipped payload length exceededt
max_decodeiiPi@(Rtgzip_encodetgzip_decodeR
RR3t
ValueError(Rtmax_gzip_decodeR`tencodedtdecoded((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_gzip_decode_limitJs
	
(
R/R0RRRRRR&RR2R7R9RA(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR"
s
			
	
tServerProxyTestCasecBs#eZdZdZdZRS(cCstjj|d|_dS(Nshttp://fake.localhost(RtTestCaseRturl(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR]scCs/tj|j}|j|dddS(NR(RRRDR
R(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRcscCs>tj}tj|jd|}|j|d|dS(NR (RR&RRDR
(RR6R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR!gs(R/R0RRR!(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRB\s		tFailingMessageClasscBseZdZRS(cCs/|j}|dkrdStjj||S(Nscontent-lengthsI am broken(Rt	mimetoolstMessaget__getitem__(Rtkey((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRHos(R/R0RH(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyREnstFailingServerTestCasecBs5eZdZdZdZdZdZRS(cCsXtj|_|jdf}tjdtd|j|jj|jjdS(NiRR(RRRRRRRR(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRxs

cCs,|jjttj_tjtj_dS(N(	RRRRRRFRGRtMessageClass(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs
cCstjj}|j|tttj_y/tjt}|j|jdddWnQtj	t
jfk
r}t|s|j
d|t|ddfqnXdS(Niis%s
%sRRi(RRR
RR&RRRRRRRRRR(RtflagvalRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt
test_basics cCsttj_y#tjt}|jddWn|tjt	j
fk
r}t|rt|dr|j
|jjddk|j
|jjddkqnX|jddS(NiiRsX-exceptionsX-tracebacksProtocolError not raised(RERRRKRRRRRRRRthasattrR!RRRR(RRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_fail_no_infos&cCsttj_ttj_y#tjt}|j	ddWntj
tjfk
r}t
|rt|drd}|j|jjd||j|jjddk	qnX|jddS(NiiRs5invalid literal for int() with base 10: 'I am broken'sx-exceptionsx-tracebacksProtocolError not raised(RERRRKR&RRRRRRRRRRNR
RRR!RR(RRRtexpected_err((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_fail_with_infos&(R/R0RRRMRORQ(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRJvs
	
			tCGIHandlerTestCasecBs,eZdZdZdZdZRS(cCstj|_dS(N(RtCGIXMLRPCRequestHandlertcgi(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRscCs
d|_dS(N(RRT(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRsc	Cstj}d|d<tj}|jjWdQX|jd|j}|jd}dj|jdd!}|j	|d|j	|d	WdQXdS(
NtGETtREQUEST_METHODiit iit400sBad Request(
RtEnvironmentVarGuardtcaptured_stdoutRTRtseektreadtsplittjoinR
(Rtenvtdata_outRRtmessage((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_cgi_gets

cCsd}tjn}tjY}tjD}|j||jdtt||d<|jj	WdQXWdQXWdQX|jd|j
}|jtj
tj|d||jd}|jttjd|jdt|dS(Nsw<?xml version='1.0'?>
        <methodCall>
            <methodName>test_method</methodName>
            <params>
                <param>
                    <value><string>foo</string></value>
                </param>
                <param>
                    <value><string>bar</string></value>
                </param>
            </params>
        </methodCall>
        itCONTENT_LENGTHi,s<?xmlsContent-Length: (\d+)i(RRYRZtcaptured_stdintwriteR[R)RRTRR\R9RRgRtfindR
RHR4tsearchtgroup(RR`R_R`tdata_inRtcontent((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyttest_cgi_xmlrpc_responses



(R/R0RRRbRk(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRRs			t
FakeSocketcBsDeZdZdZdZdZdddZdZRS(cCstj|_dS(N(tStringIOR`(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt__init__scCs|jj|t|S(N(R`ReR(Rtbuf((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR	scCs|jj|dS(N(R`Re(RRo((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytsendall
scCs
|jjS(N(R`tgetvalue(R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRqstricCs
tdS(N(tRuntimeError(RR3R4((s,/usr/local/lib/python2.7/test/test_xmlrpc.pytmakefilescCsdS(N((R((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRs(R/R0RnRRpRqRtR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRls				t
FakeTransportcBseZdZdZRS(sA Transport instance that records instead of sending a request.

    This class replaces the actual socket used by httplib with a
    FakeSocket object that records the request.  It doesn't provide a
    response.
    cCs,tjj||}t|_|_|S(N(RR&tmake_connectionRltsocktfake_socket(RthostR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRv!s(R/R0t__doc__Rv(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRustTransportSubclassTestCasecBs5eZdZdZdZdZdZRS(cCsT|}tjdd|}y|jddWntk
rO|jjSXdS(s0Return an HTTP request made via transport_class.shttp://example.com/R iiN(RRRRsRxRqR(Rttransport_classR tproxy((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt
issue_request(s		
cCs9dtfdY}|j|}|jd|dS(Nt
TestTransportcBseZdZRS(cSs'tjj|||jdddS(NsX-Testttest_custom_user_agent(RR&tsend_user_agentR,(RR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR6s(R/R0R(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR4ss X-Test: test_custom_user_agent
(RuR~tassertIn(RRtreq((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR3scCs9dtfdY}|j|}|jd|dS(NRcBseZdZRS(cSs*tjj||||jdddS(NsX-Testttest_send_host(RR&t	send_hostR,(RRRy((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR@s(R/R0R(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR>ssX-Test: test_send_host
(RuR~R(RRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR=scCs9dtfdY}|j|}|jd|dS(NRcBseZdZRS(cSs-tjj|||||jdddS(NsX-Testttest_send_request(RR&tsend_requestR,(RRRDR/((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRJs(R/R0R(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRHssX-Test: test_send_request
(RuR~R(RRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRGscCs9dtfdY}|j|}|jd|dS(NRcBseZdZRS(cSs*|jddtjj|||dS(NsX-Testttest_send_content(R,RR&R-(RRR/((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR-Ts(R/R0R-(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRRssX-Test: test_send_content
(RuR~R(RRR((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyRQs(R/R0R~RRRR(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyR{&s
		
	
	
cCsttttttg}|jt|jt|jt	|jt
|jt|jt|jt
|jt|jttj|dS(N(RRcRoRRfR{R>RRRRR"RRBRJRRRtrun_unittest(txmlrpc_tests((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt	test_main[s	








t__main__i(	iii
ii)iiii((;RRRFRqRRRRFRRRmtosR4ttestRRtImportErrorRR*RRRRRZtupdateRTRCRRcRfRoRRRRRRRt
skipUnlessRRRRRRRR"RBRGRERJRRRlR&RuR{treap_threadsRR/(((s,/usr/local/lib/python2.7/test/test_xmlrpc.pyt<module>s







(	
(:>	 QJC
5

Zerion Mini Shell 1.0