403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_docxmlrpc.cpython-36.pyc
3

�w2_�"�@sxddlmZddlZddlZddlZddlmZejd�Z	ddl
Z
dd�Zdd�ZGd	d
�d
e
j
�Zedkrte
j�dS)�)�DocXMLRPCServerN)�support�	threadingcs|sdd�S�fdd�}|S)NcSs|S)N�)�funcrr�8/opt/alt/python36/lib64/python3.6/test/test_docxmlrpc.py�<lambda>
sz)make_request_and_skipIf.<locals>.<lambda>cs�fdd�}|S)Ncs&|jjdd�|jj�tj���dS)N�GET�/)�client�request�getresponse�unittestZSkipTest)�self)�reasonrr�make_request_and_skips
zImake_request_and_skipIf.<locals>.decorator.<locals>.make_request_and_skipr)rr)rrr�	decoratorsz*make_request_and_skipIf.<locals>.decoratorr)Z	conditionrrr)rr�make_request_and_skipIf	src
Cs�tddd�}y�|jd�|jd�|jd�Gdd	�d	t�}|j�|j|��d
d�}td�d
d�}Gdd�d�}|j|�|jdd��|j|�|j|��|S|j	��YnXdS)N�	localhostrF)ZlogRequestsz"DocXMLRPCServer Test DocumentationzDocXMLRPCServer Test DocszmThis is an XML-RPC server's documentation, but the server can be used by POSTing to /RPC2. Try self.add, too.c@seZdZdd�ZdS)zmake_server.<locals>.TestClasscSs
||_dS)z7Test method's docs. This method truly does very little.N)�arg)rrrrr�test_method$sz*make_server.<locals>.TestClass.test_methodN)�__name__�
__module__�__qualname__rrrrr�	TestClass#srcSs||S)aAdd 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.
            r)�x�yrrr�add+szmake_server.<locals>.add)rcSs|S)z Use function annotations. r)rrrr�
annotation3szmake_server.<locals>.annotationc@seZdZed�dd�ZdS)z(make_server.<locals>.ClassWithAnnotation)rcSs|j�S)N)�decode)rrrrr�method_annotation8sz:make_server.<locals>.ClassWithAnnotation.method_annotationN)rrr�bytesr rrrr�ClassWithAnnotation7sr"cSs||S)Nr)rrrrrr<szmake_server.<locals>.<lambda>)rr)
r�set_server_titleZset_server_name�set_server_documentation�objectZ register_introspection_functionsZregister_instance�intZregister_function�server_close)�servrrrr"rrr�make_servers(



r)c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zee	j
jdkd�d
d��Zee	j
jdkd�dd��Z
dd�Zdd�Zdd�ZdS)�DocXMLRPCHTTPGETServercCsLdt_t�|_tj|jjd�|_|jj�|jj	d}t
jjd|�|_dS)NT)�target�zlocalhost:%d)
r�_send_traceback_headerr)r(rZThreadZ
serve_forever�thread�startZserver_address�httprZHTTPConnection)rZPORTrrr�setUpEs
zDocXMLRPCHTTPGETServer.setUpcCs2|jj�dt_|jj�|jj�|jj�dS)NF)	r�closerr-r(Zshutdownr.�joinr')rrrr�tearDownPs



zDocXMLRPCHTTPGETServer.tearDowncCsD|jjdd�|jj�}|j|jd�|j|jd�d�|j�dS)Nr	r
��zContent-typez	text/html)rrr
�assertEqual�status�	getheader�read)r�responserrr�test_valid_get_responseYs

z.DocXMLRPCHTTPGETServer.test_valid_get_responsecCsD|jjdd�|jj�}|j|jd�|j|jd�d�|j�dS)Nr	z/spami�zContent-typez
text/plain)rrr
r6r7r8r9)rr:rrr�test_invalid_get_responsecs

z0DocXMLRPCHTTPGETServer.test_invalid_get_responsecCs,|jjdd�|jj�}|jd|j��dS)z�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.
        r	r
sU<dl><dt><a name="-&lt;lambda&gt;"><strong>&lt;lambda&gt;</strong></a>(x, y)</dt></dl>N)rrr
�assertInr9)rr:rrr�test_lambdals
z"DocXMLRPCHTTPGETServer.test_lambda�z)Docstrings are omitted with -O2 and abovecCs,|jjdd�|jj�j�}|jd|�dS)aTest 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.
        r	r
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)rrr
r9r=)rr:rrr�test_autolinkingzs
		z'DocXMLRPCHTTPGETServer.test_autolinkingcCs,|jjdd�|jj�j�}|jd|�dS)z�Test the presence of three consecutive system.* methods.

        This also tests their use of parameter type recognition and the
        systems related to that process.
        r	r
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)rrr
r9r=)rr:rrr�test_system_methods�s
z*DocXMLRPCHTTPGETServer.test_system_methodscCs,|jjdd�|jj�}|jd|j��dS)zTTest that selfdot values are made strong automatically in the
        documentation.r	r
s-Try&nbsp;self.<strong>add</strong>,&nbsp;too.N)rrr
r=r9)rr:rrr�test_autolink_dotted_methods�s
z3DocXMLRPCHTTPGETServer.test_autolink_dotted_methodscCsH|jjdd�|jj�}tjjdkr(dnd}|jd|d|j��dS)	z) Test that annotations works as expected r	r
r?�s5<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)rrr
�sys�flags�optimizer=r9)rr:Z	docstringrrr�test_annotations�s

z'DocXMLRPCHTTPGETServer.test_annotationscCs~|jjd�|jjd�|jd|jj�|jd|jj�|jj�}tjd|�j	�}tjd|�j	�}|jd|�|jd|�dS)Nztest_title<script>ztest_documentation<script>z<title>(.+?)</title>z<p><tt>(.+?)</tt></p>z/<title>Python: test_title&lt;script&gt;</title>z0<p><tt>test_documentation&lt;script&gt;</tt></p>)
r(r#r$r6Zserver_titleZserver_documentationZgenerate_html_documentation�re�search�group)rZ	generated�titleZ
documentationrrr�test_server_title_escape�s

z/DocXMLRPCHTTPGETServer.test_server_title_escapeN)rrrr1r4r;r<r>rrDrErFr@rArBrGrLrrrrr*Ds	
		
r*�__main__)Z
xmlrpc.serverrZhttp.clientr0rHrDZtestr�
import_modulerrrr)ZTestCaser*r�mainrrrr�<module>s
-

Youez - 2016 - github.com/yon3zu
LinuXploit