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

ó
Nêáac@s­ddlmZddlZddlZddlZddlmZejdƒZddlZd„Z	d„Z
dejfd„ƒYZd	„Z
ed
kr©e
ƒndS(iÿÿÿÿ(tDocXMLRPCServerN(ttest_supportt	threadingcs |s
d„S‡fd†}|S(NcSs|S(N((tfunc((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt<lambda>
tcs‡fd†}|S(Ncs3|jjddƒ|jjƒtjˆƒ‚dS(NtGETt/(tclienttrequesttgetresponsetunittesttSkipTest(tself(treason(s//usr/local/lib/python2.7/test/test_docxmlrpc.pytmake_request_and_skips
((RR(R(s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt	decorators((t	conditionRR((Rs//usr/local/lib/python2.7/test/test_docxmlrpc.pytmake_request_and_skipIf	scCs²tddtƒ}y…|jdƒ|jdƒ|jdƒdtfd„ƒY}|jƒ|j|ƒƒd	„}|j|ƒ|jd
„ƒ|SWn|j	ƒ‚nXdS(Nt	localhostitlogRequestss"DocXMLRPCServer Test DocumentationsDocXMLRPCServer Test DocssmThis is an XML-RPC server's documentation, but the server can be used by POSTing to /RPC2. Try self.add, too.t	TestClasscBseZd„ZRS(cSs
||_dS(s7Test method's docs. This method truly does very little.N(targ(R
R((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_method$s(t__name__t
__module__R(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyR#scSs||S(sAdd two instances together. This follows PEP008, but has nothing
            to do with RFC1952. Case should matter: pEp008 and rFC1952.  Things
            that start with http and ftp should be auto-linked, too:
            http://google.com.
            ((txty((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytadd+scSs||S(N((RR((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyR4R(Ri(
RtFalsetset_server_titletset_server_nametset_server_documentationtobjectt register_introspection_functionstregister_instancetregister_functiontserver_close(tservRR((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytmake_servers 


	

tDocXMLRPCHTTPGETServercBseZd„Zd„Zd„Zd„Zd„Zeej	j
dkdƒd„ƒZeej	j
dkdƒd„ƒZd	„Z
d
„ZRS(cCsgtt_tƒ|_tjd|jjƒ|_|jj	ƒ|jj
d}tjd|ƒ|_
dS(Nttargetislocalhost:%d(tTrueRt_send_traceback_headerR'R&RtThreadt
serve_forevertthreadtstarttserver_addressthttplibtHTTPConnectionR(R
tPORT((s//usr/local/lib/python2.7/test/test_docxmlrpc.pytsetUp;s	
cCsA|jjƒtt_|jjƒ|jjƒ|jj	ƒdS(N(
RtcloseRRR+R&tshutdownR.tjoinR%(R
((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttearDownFs

	

cCs\|jjddƒ|jjƒ}|j|jdƒ|j|jdƒdƒ|jƒdS(NRRiÈsContent-types	text/html(RR	R
tassertEqualtstatust	getheadertread(R
tresponse((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_valid_get_responseOs
cCs\|jjddƒ|jjƒ}|j|jdƒ|j|jdƒdƒ|jƒdS(NRs/spami”sContent-types
text/plain(RR	R
R9R:R;R<(R
R=((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_invalid_get_responseYs
cCs<|jjddƒ|jjƒ}|jd|jƒƒdS(séTest that lambda functionality stays the same.  The output produced
        currently is, I suspect invalid because of the unencoded brackets in the
        HTML, "<lambda>".

        The subtraction lambda method is tested.
        RRsU<dl><dt><a name="-&lt;lambda&gt;"><strong>&lt;lambda&gt;</strong></a>(x, y)</dt></dl>N(RR	R
tassertInR<(R
R=((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_lambdabs	is)Docstrings are omitted with -O2 and abovecCs<|jjddƒ|jjƒ}|jd|jƒƒdS(sTest that the server correctly automatically wraps references to
        PEPS and RFCs with links, and that it linkifies text starting with
        http or ftp protocol prefixes.

        The documentation for the "add" method contains the test material.
        RRsM<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd><tt>Add&nbsp;two&nbsp;instances&nbsp;together.&nbsp;This&nbsp;follows&nbsp;<a href="http://www.python.org/dev/peps/pep-0008/">PEP008</a>,&nbsp;but&nbsp;has&nbsp;nothing<br>
to&nbsp;do&nbsp;with&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>.&nbsp;Case&nbsp;should&nbsp;matter:&nbsp;pEp008&nbsp;and&nbsp;rFC1952.&nbsp;&nbsp;Things<br>
that&nbsp;start&nbsp;with&nbsp;http&nbsp;and&nbsp;ftp&nbsp;should&nbsp;be&nbsp;auto-linked,&nbsp;too:<br>
<a href="http://google.com">http://google.com</a>.</tt></dd></dl>N(RR	R
R@R<(R
R=((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_autolinkingps
		cCs<|jjddƒ|jjƒ}|jd|jƒƒdS(s³Test the presence of three consecutive system.* methods.

        This also tests their use of parameter type recognition and the
        systems related to that process.
        RRs'<dl><dt><a name="-system.listMethods"><strong>system.listMethods</strong></a>()</dt><dd><tt><a href="#-system.listMethods">system.listMethods</a>()&nbsp;=&gt;&nbsp;['add',&nbsp;'subtract',&nbsp;'multiple']<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;methods&nbsp;supported&nbsp;by&nbsp;the&nbsp;server.</tt></dd></dl>
 <dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodHelp">system.methodHelp</a>('add')&nbsp;=&gt;&nbsp;"Adds&nbsp;two&nbsp;integers&nbsp;together"<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;string&nbsp;containing&nbsp;documentation&nbsp;for&nbsp;the&nbsp;specified&nbsp;method.</tt></dd></dl>
 <dl><dt><a name="-system.methodSignature"><strong>system.methodSignature</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodSignature">system.methodSignature</a>('add')&nbsp;=&gt;&nbsp;[double,&nbsp;int,&nbsp;int]<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;list&nbsp;describing&nbsp;the&nbsp;signature&nbsp;of&nbsp;the&nbsp;method.&nbsp;In&nbsp;the<br>
above&nbsp;example,&nbsp;the&nbsp;add&nbsp;method&nbsp;takes&nbsp;two&nbsp;integers&nbsp;as&nbsp;arguments<br>
and&nbsp;returns&nbsp;a&nbsp;double&nbsp;result.<br>
&nbsp;<br>
This&nbsp;server&nbsp;does&nbsp;NOT&nbsp;support&nbsp;system.methodSignature.</tt></dd></dl>N(RR	R
R@R<(R
R=((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_system_methodsˆs
cCs<|jjddƒ|jjƒ}|jd|jƒƒdS(sTTest that selfdot values are made strong automatically in the
        documentation.RRs-Try&nbsp;self.<strong>add</strong>,&nbsp;too.N(RR	R
R@R<(R
R=((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_autolink_dotted_methods«s	cCs¯|jjdƒ|jjdƒ|jd|jjƒ|jd|jjƒ|jjƒ}tjd|ƒj	ƒ}tjd|ƒj	ƒ}|jd|ƒ|jd|ƒdS(sSTest that the server title and documentation
        are escaped for HTML.
        stest_title<script>stest_documentation<script>s<title>(.+?)</title>s<p><tt>(.+?)</tt></p>s/<title>Python: test_title&lt;script&gt;</title>s0<p><tt>test_documentation&lt;script&gt;</tt></p>N(
R&RR R9tserver_titletserver_documentationtgenerate_html_documentationtretsearchtgroup(R
t	generatedttitlet
documentation((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyttest_server_title_escape´s	
		(RRR4R8R>R?RARtsystflagstoptimizeRBRCRDRN(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyR(:s				
			"		cCstjtƒdS(N(Rtrun_unittestR((((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt	test_mainÇst__main__(RR1RHROttestRt
import_moduleRRRR'tTestCaseR(RSR(((s//usr/local/lib/python2.7/test/test_docxmlrpc.pyt<module>s		#	

Zerion Mini Shell 1.0