Current File : //opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyo
�
��Wc@s�ddlmZddlZddlZddlmZejd�ZddlZddlZddl	Z	dad�Zd�Z
de	jfd��YZd	�Zed
kr�e�ndS(i����(tDocXMLRPCServerN(ttest_supportt	threadingcs |s
d�S�fd�}|S(NcSs|S(N((tfunc((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyt<lambda>scs�fd�}|S(Ncs3|jjdd�|jj�tj���dS(NtGETt/(tclienttrequesttgetresponsetunittesttSkipTest(tself(treason(sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pytmake_request_and_skips
((RR(R
(sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyt	decorators((t	conditionR
R((R
sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pytmake_request_and_skipIfscCs
tddt�}z�y�|jj�da|jd�|jd�|jd�dtfd	��Y}|j	�|j
|��d
�}|j|�|jd��x$|dkr�|j�|d8}q�WWntj
k
r�nXWd|j�da|j�XdS(
Nt	localhostitlogRequestsis"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((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttest_method*s(t__name__t
__module__R(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/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((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pytadd1scSs||S(N((RR((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyR:s(Ri(RtFalsetsockettgetsocknametPORTtset_server_titletset_server_nametset_server_documentationtobjectt register_introspection_functionstregister_instancetregister_functionthandle_requestttimeouttserver_closetNonetset(tevttnumrequeststservRR((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pytservers,


	


tDocXMLRPCHTTPGETServercBs�eZd�Zd�Zd�Zd�Zd�Zeej	j
dkd�d��Zeej	j
dkd�d��Zd	�Z
RS(
cCs�tj�|_tt_tj�|_tj	dt
d|jdf�j�d}x3|dkr�tdkr�tjd�|d8}qUWtjdt�|_dS(Nttargettargsii�ig����MbP?slocalhost:%d(Rtthreading_setupt_threadstTrueRt_send_traceback_headerRtEventR,tThreadR/tstartRR*ttimetsleepthttplibtHTTPConnectionR(Rtn((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pytsetUpGs	%
cCs7|jj�|jj�tt_tj|j	�dS(N(
RtcloseR,twaitRRR6Rtthreading_cleanupR4(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttearDownWs

	cCs\|jjdd�|jj�}|j|jd�|j|jd�d�|j�dS(NRRi�sContent-types	text/html(RRR	tassertEqualtstatust	getheadertread(Rtresponse((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttest_valid_get_response`s
cCs\|jjdd�|jj�}|j|jd�|j|jd�d�|j�dS(NRs/spami�sContent-types
text/plain(RRR	RDRERFRG(RRH((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttest_invalid_get_responsejs
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(RRR	tassertInRG(RRH((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttest_lambdass	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(RRR	RKRG(RRH((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttest_autolinking�s
		cCs<|jjdd�|jj�}|jd|j��dS(s�Test the precense 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(RRR	RKRG(RRH((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/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(RRR	RKRG(RRH((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyttest_autolink_dotted_methods�s	(RRR?RCRIRJRLRtsystflagstoptimizeRMRNRO(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyR0Fs				
			"cCstjt�dS(N(Rtrun_unittestR0(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyt	test_main�st__main__(RR<RPttestRt
import_moduleRR:RR
R*RRR/tTestCaseR0RTR(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_docxmlrpc.pyt<module>s		,