Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_docxmlrpc.cpython-312.pyc

�

'Μge$����ddlmZddlZddlZddlZddlZddlZddlm	Z	e	jd��d�Zd�ZGd�d	ej�Zed
k(rej �yy)�)�DocXMLRPCServerN)�supportT)�modulec���|sd�S�fd�}|S)Nc��|S�N�)�funcs �0/usr/local/lib/python3.12/test/test_docxmlrpc.py�<lambda>z)make_request_and_skipIf.<locals>.<lambda>s��D�c����fd�}|S)Nc���|jjdd�|jj�tj���)N�GET�/)�client�request�getresponse�unittest�SkipTest)�self�reasons �r�make_request_and_skipzImake_request_and_skipIf.<locals>.decorator.<locals>.make_request_and_skips8����K�K����s�+��K�K�#�#�%��#�#�F�+�+r
r	)r
rrs  �r�	decoratorz*make_request_and_skipIf.<locals>.decorators���	,�%�$r
r	)�	conditionrrs ` r�make_request_and_skipIfrs���� � �%��r
c���tdd��}	|jd�|jd�|jd�Gd�dt�}|j�|j
|��d	�}d
tfd�}Gd�d
�}|j|�|jd��|j|�|j
|��|S#|j��xYw)N)�	localhostrF)�logRequestsz"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��eZdZd�Zy)�make_server.<locals>.TestClassc��||_y)z7Test method's docs. This method truly does very little.N)�arg)rr#s  r�test_methodz*make_server.<locals>.TestClass.test_method&s	����r
N)�__name__�
__module__�__qualname__r$r	r
r�	TestClassr!%s��
r
r(c��||zS)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�ys  r�addzmake_server.<locals>.add-s
���q�5�Lr
r+c��|S)z Use function annotations. r	)r+s r�
annotationzmake_server.<locals>.annotation5s���Hr
c��eZdZdefd�Zy)�(make_server.<locals>.ClassWithAnnotationr+c�"�|j�Sr)�decode)rr+s  r�method_annotationz:make_server.<locals>.ClassWithAnnotation.method_annotation:s���x�x�z�!r
N)r%r&r'�bytesr4r	r
r�ClassWithAnnotationr19s��
"�5�
"r
r6c��||z
Srr	r*s  rrzmake_server.<locals>.<lambda>>s��A�a�Cr
)
r�set_server_title�set_server_name�set_server_documentation�object� register_introspection_functions�register_instance�int�register_function�server_close)�servr(r-r/r6s     r�make_serverrBs����+��?�D�(����B�C����8�9��%�%�
B�	C�
	��	�
	
�-�-�/����y�{�+�	�	�#�	�	"�	"�	
���s�#����/�0����z�*����2�4�5���������
�s�C
C�C-c���eZdZd�Zd�Zd�Zd�Zd�Zd�Ze	e
jjdk\d�d	��Z
e	e
jjdk\d�d
��Zd�Zd�Zd
�Zy)�DocXMLRPCHTTPGETServerc�J�dt_t�|_t	j
|jj��|_|jj�|jjd}tjjd|z�|_y)NT)�target�zlocalhost:%d)
r�_send_traceback_headerrBrA�	threading�Thread�
serve_forever�thread�start�server_address�httpr�HTTPConnection)r�PORTs  r�setUpzDocXMLRPCHTTPGETServer.setUpGsn��15��.��M��	��&�&�d�i�i�.E�.E�F����������y�y�'�'��*���k�k�0�0��$�1F�G��r
c���|jj�dt_|jj�|jj�|jj�y)NF)	r�closerrHrA�shutdownrL�joinr@)rs r�tearDownzDocXMLRPCHTTPGETServer.tearDownRsL��������27��.��	�	�����������	�	��� r
c�
�|jjdd�|jj�}|j|jd�|j|jd�d�|j
�y)Nrr���Content-typeztext/html; charset=UTF-8�rrr�assertEqual�status�	getheader�read�r�responses  r�test_valid_get_responsez.DocXMLRPCHTTPGETServer.test_valid_get_response[sc�������E�3�'��;�;�*�*�,��������#�.�����+�+�N�;�=W�X�	�
�
�r
c�
�|jjdd�|jj�}|j|jd�|j|jd�d�|j
�y)Nrz
/pydoc.cssrYrZztext/css; charset=UTF-8r[r`s  r�test_get_cssz#DocXMLRPCHTTPGETServer.test_get_cssesc�������E�<�0��;�;�*�*�,��������#�.�����+�+�N�;�=V�W�	�
�
�r
c�
�|jjdd�|jj�}|j|jd�|j|jd�d�|j
�y)Nrz/spami�rZz
text/plainr[r`s  r�test_invalid_get_responsez0DocXMLRPCHTTPGETServer.test_invalid_get_responseos`�������E�7�+��;�;�*�*�,��������#�.�����+�+�N�;�\�J��
�
�r
c��|jjdd�|jj�}|jd|j	��y)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.
        rrsU<dl><dt><a name="-&lt;lambda&gt;"><strong>&lt;lambda&gt;</strong></a>(x, y)</dt></dl>N�rrr�assertInr_r`s  r�test_lambdaz"DocXMLRPCHTTPGETServer.test_lambdaxsE��	
�����E�3�'��;�;�*�*�,���
�
�F��m�m�o�	'r
�z)Docstrings are omitted with -O2 and abovec��|jjdd�|jj�j�}|j	d|�y)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.
        rrsG<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="https://peps.python.org/pep-0008/">PEP008</a>,&nbsp;but&nbsp;has&nbsp;nothing<br>
to&nbsp;do&nbsp;with&nbsp;<a href="https://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�rrrr_rir`s  r�test_autolinkingz'DocXMLRPCHTTPGETServer.test_autolinking�sK��	
�����E�3�'��;�;�*�*�,�1�1�3���
�
�	6�9A�
	Br
c��|jjdd�|jj�j�}|j	d|�y)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.
        rrs�<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>Nrmr`s  r�test_system_methodsz*DocXMLRPCHTTPGETServer.test_system_methods�sI��	
�����E�3�'��;�;�*�*�,�1�1�3���
�
�1�4<�!	=r
c��|jjdd�|jj�}|jd|j	��y)zTTest that selfdot values are made strong automatically in the
        documentation.rrs-Try&nbsp;self.<strong>add</strong>,&nbsp;too.Nrhr`s  r�test_autolink_dotted_methodsz3DocXMLRPCHTTPGETServer.test_autolink_dotted_methods�sB��	
�����E�3�'��;�;�*�*�,���
�
�J��m�m�o�	'r
c��|jjdd�|jj�}tjj
dk\rdnd}|j
d|zdz|j��y)	z) Test that annotations works as expected rrrkr
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)rrr�sys�flags�optimizerir_)rra�	docstrings   r�test_annotationsz'DocXMLRPCHTTPGETServer.test_annotations�st�������E�3�'��;�;�*�*�,���I�I�.�.�!�3�S�M�	��
�
�� )�*�-C�C�
�M�M�O�	r
c��|jjd�|jjd�|jd|jj�|jd|jj
�|jj
�}tjd|�j�}tjd|�j�}|jd|�|jd|�y)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>)
rAr8r:r\�server_title�server_documentation�generate_html_documentation�re�search�group)r�	generated�title�
documentations    r�test_server_title_escapez/DocXMLRPCHTTPGETServer.test_server_title_escape�s���	
�	�	�"�"�#7�8��	�	�*�*�+G�H����-�t�y�y�/E�/E�F����5��	�	�.�.�	0��I�I�9�9�;�	��	�	�1�9�=�C�C�E���	�	�":�I�F�L�L�N�
����J�E�R����K�]�[r
N)r%r&r'rRrWrbrdrfrjrrtrurvrnrprrrxr�r	r
rrDrDFs���	H�!����'��S�Y�Y�/�/�1�4�@�B�B�B�B�,�S�Y�Y�/�/�1�4�@�B�=�B�=�6'��
\r
rD�__main__)�
xmlrpc.serverr�http.clientrOr}rtrIr�testr�requires_working_socketrrB�TestCaserDr%�mainr	r
r�<module>r�sf��)��	�
��������t�,��+�ZX\�X�.�.�X\�v�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists