Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/test/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/test/__pycache__/test_docxmlrpc.cpython-33.pyc

�
��fO!c@s�ddlmZddlZddlZddlmZejd�Zddl	Z	ddl
Z
ddlZda
dd�Zdd�ZGd	d
�d
ej�Zdd�Zed
kr�e�ndS(i(uDocXMLRPCServerN(usupportu	threadingcs&|sdd�S�fdd�}|S(NcSs|S(N((ufunc((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu<lambda>su)make_request_and_skipIf.<locals>.<lambda>cs�fdd�}|S(Ncs3|jjdd�|jj�tj���dS(NuGETu/(uclienturequestugetresponseuunittestuSkipTest(uself(ureason(u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyumake_request_and_skips
uImake_request_and_skipIf.<locals>.decorator.<locals>.make_request_and_skip((ufuncumake_request_and_skip(ureason(u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu	decoratorsu*make_request_and_skipIf.<locals>.decorator((u	conditionureasonu	decorator((ureasonu8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyumake_request_and_skipIfs
umake_request_and_skipIfcCsVtddd�}z"y|jj�da|jd�|jd�|jd�Gdd	�d	t�}|j	�|j
|��d
d�}tdd
d��}Gdd�d�}|j|�|jdd��|j|�|j
|��x$|dkr|j
�|d8}q�WWntjk
r2YnXWd|j�da|j�XdS(Nu	localhostiulogRequestsiu"DocXMLRPCServer Test DocumentationuDocXMLRPCServer Test DocsumThis is an XML-RPC server's documentation, but the server can be used by POSTing to /RPC2. Try self.add, too.cBs |EeZdZdd�ZdS(userver.<locals>.TestClasscSs
||_dS(u7Test method's docs. This method truly does very little.N(uarg(uselfuarg((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_method*su%server.<locals>.TestClass.test_methodN(u__name__u
__module__u__qualname__utest_method(u
__locals__((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu	TestClass)su	TestClasscSs||S(uAdd 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.
            ((uxuy((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyuadd1suserver.<locals>.add(uxcSs|S(u Use function annotations. ((ux((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu
annotation9suserver.<locals>.annotationcBs)|EeZdZeddd��ZdS(u#server.<locals>.ClassWithAnnotation(uxcSs
|j�S(N(udecode(uselfux((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyumethod_annotation>su5server.<locals>.ClassWithAnnotation.method_annotationN(u__name__u
__module__u__qualname__ubytesumethod_annotation(u
__locals__((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyuClassWithAnnotation=suClassWithAnnotationcSs||S(N((uxuy((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu<lambda>Bsuserver.<locals>.<lambda>(u	localhostiF(uDocXMLRPCServeruFalseusocketugetsocknameuPORTuset_server_titleuset_server_nameuset_server_documentationuobjectu register_introspection_functionsuregister_instanceuinturegister_functionuhandle_requestutimeoutuserver_closeuNoneuset(uevtunumrequestsuservu	TestClassuaddu
annotationuClassWithAnnotation((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyuservers2





	
uservercBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zee	j
jdkd�d
d��Zee	j
jdkd�dd��Z
dd�Zdd�ZdS(uDocXMLRPCHTTPGETServercCs�tj�|_dt_tj�|_tj	dt
d|jdf�j�d}x3|dkr�tdkr�tjd�|d8}qUWtjjdt�|_dS(	Nutargetuargsii�ig����MbP?ulocalhost:%dT(usupportuthreading_setupu_threadsuTrueuDocXMLRPCServeru_send_traceback_headeru	threadinguEventuevtuThreaduserverustartuPORTuNoneutimeusleepuhttpuclientuHTTPConnection(uselfun((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyusetUpQs	%
uDocXMLRPCHTTPGETServer.setUpcCs7|jj�|jj�dt_tj|j	�dS(NF(
uclientucloseuevtuwaituFalseuDocXMLRPCServeru_send_traceback_headerusupportuthreading_cleanupu_threads(uself((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutearDownas

	uDocXMLRPCHTTPGETServer.tearDowncCs\|jjdd�|jj�}|j|jd�|j|jd�d�|j�dS(NuGETu/i�uContent-typeu	text/html(uclienturequestugetresponseuassertEqualustatusu	getheaderuread(uselfuresponse((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_valid_get_responsejs
u.DocXMLRPCHTTPGETServer.test_valid_get_responsecCs\|jjdd�|jj�}|j|jd�|j|jd�d�|j�dS(NuGETu/spami�uContent-typeu
text/plain(uclienturequestugetresponseuassertEqualustatusu	getheaderuread(uselfuresponse((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_invalid_get_responsets
u0DocXMLRPCHTTPGETServer.test_invalid_get_responsecCs<|jjdd�|jj�}|jd|j��dS(u�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.
        uGETu/sU<dl><dt><a name="-&lt;lambda&gt;"><strong>&lt;lambda&gt;</strong></a>(x, y)</dt></dl>N(uclienturequestugetresponseuassertInuread(uselfuresponse((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_lambda}s	u"DocXMLRPCHTTPGETServer.test_lambdaiu)Docstrings are omitted with -O2 and abovecCs<|jjdd�|jj�j�}|jd|�dS(uTest 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.
        uGETu/sM<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(uclienturequestugetresponseureaduassertIn(uselfuresponse((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_autolinking�s
		u'DocXMLRPCHTTPGETServer.test_autolinkingcCs<|jjdd�|jj�j�}|jd|�dS(u�Test the precense of three consecutive system.* methods.

        This also tests their use of parameter type recognition and the
        systems related to that process.
        uGETu/s�<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(uclienturequestugetresponseureaduassertIn(uselfuresponse((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_system_methods�s
u*DocXMLRPCHTTPGETServer.test_system_methodscCs<|jjdd�|jj�}|jd|j��dS(uTTest that selfdot values are made strong automatically in the
        documentation.uGETu/s-Try&nbsp;self.<strong>add</strong>,&nbsp;too.N(uclienturequestugetresponseuassertInuread(uselfuresponse((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_autolink_dotted_methods�s	u3DocXMLRPCHTTPGETServer.test_autolink_dotted_methodscCsb|jjdd�|jj�}tjjdkr:dnd}|jd|d|j��dS(	u) Test that annotations works as expected uGETu/iss5<dd><tt>Use&nbsp;function&nbsp;annotations.</tt></dd>sJ<dl><dt><a name="-annotation"><strong>annotation</strong></a>(x: int)</dt>se</dl>
<dl><dt><a name="-method_annotation"><strong>method_annotation</strong></a>(x: bytes)</dt></dl>N(uclienturequestugetresponseusysuflagsuoptimizeuassertInuread(uselfuresponseu	docstring((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyutest_annotations�su'DocXMLRPCHTTPGETServer.test_annotationsN(u__name__u
__module__u__qualname__usetUputearDownutest_valid_get_responseutest_invalid_get_responseutest_lambdaumake_request_and_skipIfusysuflagsuoptimizeutest_autolinkingutest_system_methodsutest_autolink_dotted_methodsutest_annotations(u
__locals__((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyuDocXMLRPCHTTPGETServerPs	
		uDocXMLRPCHTTPGETServercCstjt�dS(N(usupporturun_unittestuDocXMLRPCHTTPGETServer(((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu	test_main�su	test_mainu__main__(u
xmlrpc.serveruDocXMLRPCServeruhttp.clientuhttpusysutestusupportu
import_moduleu	threadingutimeusocketuunittestuNoneuPORTumake_request_and_skipIfuserveruTestCaseuDocXMLRPCHTTPGETServeru	test_mainu__name__(((u8/opt/alt/python33/lib64/python3.3/test/test_docxmlrpc.pyu<module>s6�