403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/tornado/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/tornado/test/__pycache__/testing_test.cpython-311.pyc
�

��b�+����ddlmZmZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlZddlZddlZddlZddlZddlZddlZddlZddlZejd���ZGd	�d
e��ZGd�de��ZGd
�de
��ZGd�dej��ZGd�dej��Z Gd�dej��Z!Gd�de��Z"Gd�de��Z#e$dkrej%��dSdS)�)�gen�ioloop)�
HTTPServer)�Event)�ignore_deprecation)�AsyncHTTPTestCase�
AsyncTestCase�bind_unused_port�gen_test��ApplicationNc#�K�tj�|��}|tj|<	dV�|�tj|=dS|tj|<dS#|�tj|=n|tj|<wxYw�N)�os�environ�get)�name�value�	old_values   �;/usr/lib/python3/dist-packages/tornado/test/testing_test.py�set_environrs������
���t�$�$�I��B�J�t��)�
�������
�4� � � �(�B�J�t��������
�4� � �(�B�J�t��(�(�(�(s�A�!A9c��eZdZd�Zd�ZdS)�AsyncTestCaseTestc��|jj}|j�|��dz|j��|���|j�|��dz|j��|�|j��5|�d���ddd��n#1swxYwY|j�|��dz|j��tdd��5|�|j��5|���ddd��n#1swxYwYddd��dS#1swxYwYdS)N�{�G�z�?���timeout�ASYNC_TEST_TIMEOUTz0.01)�io_loop�time�add_timeout�stop�wait�assertRaises�failureExceptionr)�selfr!s  r�test_wait_timeoutz#AsyncTestCaseTest.test_wait_timeout!s����|� ��	
�� � �����$���	�:�:�:��	�	����	
�� � �����!��T�Y�7�7�7�
�
�
�t�4�
5�
5�	$�	$��I�I�d�I�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	
�� � �����!��T�Y�7�7�7�
�-�v�
6�
6�	�	��"�"�4�#8�9�9�
�
��	�	����
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	sH�B4�4B8�;B8�:E�D6�*E�6D:	�:E�=D:	�>E�E�Ec�F�|j�|j���dz|j��|�d���|j�|j���dz|j��|�d���dS)ze
        This test makes sure that a second call to wait()
        clears the first timeout.
        g皙�����?rg�������?g�������?N)r r"r!r#r$�r's r�test_subsequent_wait_callsz,AsyncTestCaseTest.test_subsequent_wait_calls3s���	
�� � ���!2�!2�!4�!4�t�!;�T�Y�G�G�G��	�	�#�	����	
�� � ���!2�!2�!4�!4�s�!:�D�I�F�F�F��	�	�#�	������N)�__name__�
__module__�__qualname__r(r,�r-rrr s2���������$����r-rc�$��eZdZ�fd�Zd�Z�xZS)�LeakTestc�n��t�����tj��dSr)�super�tearDown�gc�collect�r'�	__class__s �rr6zLeakTest.tearDownBs(���
��������
�
�����r-c����t����fd�}|j�|��|j�|j��|���dS)Nc��n�K�	�����d{V��dS#tj$rYdSwxYwr)r$�asyncio�CancelledError)�events�r�callbackz0LeakTest.test_leaked_coroutine.<locals>.callbackNsW�����
��j�j�l�l�"�"�"�"�"�"�"�"�"���)�
�
�
����
���s�!�4�4)rr �add_callbackr#r$)r'r@r?s  @r�test_leaked_coroutinezLeakTest.test_leaked_coroutineGsh���
����	�	�	�	�	�	
��!�!�(�+�+�+���!�!�$�)�,�,�,��	�	�����r-)r.r/r0r6rB�
__classcell__�r:s@rr3r3AsG������������
������r-r3c�:��eZdZ�fd�Zd�Zd�Zd�Z�fd�Z�xZS)�AsyncHTTPTestCaseTestc�
��t�����t��\}}t��}t	|fi|�����}|�|��||_||_dSr)	r5�setUpr
r
r�get_httpserver_options�
add_socket�second_port�
second_server)r'�sock�port�app�serverr:s     �rrHzAsyncHTTPTestCaseTest.setUpZsw���
���
�
����%�'�'�
��d��m�m���C�A�A�4�#>�#>�#@�#@�A�A�����$�������#����r-c��t��Srrr+s r�get_appzAsyncHTTPTestCaseTest.get_appds���}�}�r-c��d}|�|��}|�|jj|�|����dS)Nz/path)�fetch�assertEqual�request�url�get_url�r'�path�responses   r�test_fetch_segmentz(AsyncHTTPTestCaseTest.test_fetch_segmentgsF�����:�:�d�#�#������)�-�t�|�|�D�/A�/A�B�B�B�B�Br-c��d|jz}|�|��}|�|jj|��dS)Nzhttp://localhost:%d/path)rKrTrUrVrWrYs   r�test_fetch_full_http_urlz.AsyncHTTPTestCaseTest.test_fetch_full_http_urllsD��*�D�,<�<���:�:�d�#�#������)�-�t�4�4�4�4�4r-c�z��|j���t�����dSr)rLr#r5r6r9s �rr6zAsyncHTTPTestCaseTest.tearDownts4�������!�!�!�
���������r-)	r.r/r0rHrRr\r^r6rCrDs@rrFrFYs��������$�$�$�$�$����C�C�C�
5�5�5���������r-rFc�|�eZdZd�Zejej��dkd��d���Zd�Z	d�Z
d�ZdS)	�AsyncTestCaseWrapperTestc�0�Gd�dt��}|d��}tj��}|�|��|�t|j��d��|�d|jdd��dS)Nc��eZdZd�ZdS)�AAsyncTestCaseWrapperTest.test_undecorated_generator.<locals>.Testc3�K�dV�dSrr1r+s r�test_genzJAsyncTestCaseWrapperTest.test_undecorated_generator.<locals>.Test.test_gen|s���������r-N)r.r/r0rfr1r-r�Testrd{s#������
�
�
�
�
r-rgrfr�should be decoratedr�r	�unittest�
TestResult�runrU�len�errors�assertIn�r'rg�test�results    r�test_undecorated_generatorz3AsyncTestCaseWrapperTest.test_undecorated_generatorzs���	�	�	�	�	�=�	�	�	��t�J�����$�&�&�������������V�]�+�+�Q�/�/�/��
�
�+�V�]�1�-=�a�-@�A�A�A�A�Ar-�PyPyz+pypy destructor warnings cannot be silencedc��Gd�dt��}|d��}tj��}tj��5tjd��|�|��ddd��n#1swxYwY|�t|j	��d��|�
d|j	dd��dS)Nc��eZdZd�ZdS)�AAsyncTestCaseWrapperTest.test_undecorated_coroutine.<locals>.Testc��
K�dSrr1r+s r�	test_corozKAsyncTestCaseWrapperTest.test_undecorated_coroutine.<locals>.Test.test_coro�s�����r-N)r.r/r0ryr1r-rrgrw��#������
�
�
�
�
r-rgry�ignorerrhr)r	rjrk�warnings�catch_warnings�simplefilterrlrUrmrnrorps    r�test_undecorated_coroutinez3AsyncTestCaseWrapperTest.test_undecorated_coroutine�s��
	�	�	�	�	�=�	�	�	��t�K� � ���$�&�&���
$�
&�
&�	�	��!�(�+�+�+��H�H�V����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	
����V�]�+�+�Q�/�/�/��
�
�+�V�]�1�-=�a�-@�A�A�A�A�As�*A;�;A?�A?c�2�Gd�dt��}|d��}tj��}|�|��|�t|j��d��|�t|j��d��dS)Nc�@�eZdZejd��d���ZdS)�KAsyncTestCaseWrapperTest.test_undecorated_generator_with_skip.<locals>.Testzdon't run thisc3�K�dV�dSrr1r+s rrfzTAsyncTestCaseWrapperTest.test_undecorated_generator_with_skip.<locals>.Test.test_gen�s���������r-N)r.r/r0rj�skiprfr1r-rrgr��s;������
�X�]�+�
,�
,�
�
�-�
,�
�
�
r-rgrfrr)r	rjrkrlrUrmrn�skippedrps    r�$test_undecorated_generator_with_skipz=AsyncTestCaseWrapperTest.test_undecorated_generator_with_skip�s���	�	�	�	�	�=�	�	�	�
�t�J�����$�&�&�������������V�]�+�+�Q�/�/�/�����V�^�,�,�a�0�0�0�0�0r-c�0�Gd�dt��}|d��}tj��}|�|��|�t|j��d��|�d|jdd��dS)Nc��eZdZd�ZdS)�8AsyncTestCaseWrapperTest.test_other_return.<locals>.Testc��dS)N�*r1r+s r�test_other_returnzJAsyncTestCaseWrapperTest.test_other_return.<locals>.Test.test_other_return�s���rr-N)r.r/r0r�r1r-rrgr��s#������
�
�
�
�
r-rgr�rz%Return value from test method ignoredrrirps    rr�z*AsyncTestCaseWrapperTest.test_other_return�s���	�	�	�	�	�=�	�	�	��t�'�(�(���$�&�&�������������V�]�+�+�Q�/�/�/��
�
�=�v�}�Q�?O�PQ�?R�S�S�S�S�Sr-c��Gd�dt��}|d��}|�tj|j��|jj��dS)Nc��eZdZd�ZdS)�2AsyncTestCaseWrapperTest.test_unwrap.<locals>.Testc��dSrr1r+s r�test_fooz;AsyncTestCaseWrapperTest.test_unwrap.<locals>.Test.test_foo�s���r-N)r.r/r0r�r1r-rrgr��rzr-rgr�)r	�assertIs�inspect�unwrapr��orig_method)r'rgrqs   r�test_unwrapz$AsyncTestCaseWrapperTest.test_unwrap�st��	�	�	�	�	�=�	�	�	��t�J�����
�
��N�4�=�)�)��M�%�	
�	
�	
�	
�	
r-N)r.r/r0rsrj�skipIf�platform�python_implementationrr�r�r�r1r-rrarays�������	B�	B�	B��X�_�&��&�(�(�F�2�5���B�B�	��B� 
1�
1�
1�	T�	T�	T�	
�	
�	
�	
�	
r-rac��eZdZd�ZdS)�SetUpTearDownTestc���g�tj��}G�fd�dtj��}G�fd�dt|��}|d���|��gd�}|�|���dS)a
        This test makes sure that AsyncTestCase calls super methods for
        setUp and tearDown.

        InheritBoth is a subclass of both AsyncTestCase and
        SetUpTearDown, with the ordering so that the super of
        AsyncTestCase will be SetUpTearDown.
        c�$��eZdZ�fd�Z�fd�ZdS)�>SetUpTearDownTest.test_set_up_tear_down.<locals>.SetUpTearDownc�2����d��dS)NrH��append�r'�eventss �rrHzDSetUpTearDownTest.test_set_up_tear_down.<locals>.SetUpTearDown.setUp�s����
�
�g�&�&�&�&�&r-c�2����d��dS)Nr6r�r�s �rr6zGSetUpTearDownTest.test_set_up_tear_down.<locals>.SetUpTearDown.tearDown�s����
�
�j�)�)�)�)�)r-N)r.r/r0rHr6�r�s�r�
SetUpTearDownr��sG�������
'�
'�
'�
'�
'�
*�
*�
*�
*�
*�
*�
*r-r�c���eZdZ�fd�ZdS)�<SetUpTearDownTest.test_set_up_tear_down.<locals>.InheritBothc�2����d��dS�Nrqr�r�s �rrqzASetUpTearDownTest.test_set_up_tear_down.<locals>.InheritBoth.test�s����
�
�f�%�%�%�%�%r-N)r.r/r0rqr�s�r�InheritBothr��s.�������
&�
&�
&�
&�
&�
&�
&r-r�rq)rHrqr6N)rjrk�TestCaser	rlrU)r'rrr�r��expectedr�s     @r�test_set_up_tear_downz'SetUpTearDownTest.test_set_up_tear_down�s�������$�&�&��	*�	*�	*�	*�	*�	*�	*�H�-�	*�	*�	*�	&�	&�	&�	&�	&�	&�	&�-��	&�	&�	&�	��F������'�'�'�0�0�0������6�*�*�*�*�*r-N)r.r/r0r�r1r-rr�r��s#������+�+�+�+�+r-r�c��eZdZd�ZdS)�"AsyncHTTPTestCaseSetUpTearDownTestc��tj��}Gd�dt��}|d��}|�|��|�t|d����|�t|d����dS)Nc��eZdZd�Zd�ZdS)�eAsyncHTTPTestCaseSetUpTearDownTest.test_tear_down_releases_app_and_http_server.<locals>.SetUpTearDownc��t��Srrr+s rrRzmAsyncHTTPTestCaseSetUpTearDownTest.test_tear_down_releases_app_and_http_server.<locals>.SetUpTearDown.get_app�s��"�}�}�$r-c��|�t|d����|�t|d����dS)N�_app�http_server)�
assertTrue�hasattrr+s rrqzjAsyncHTTPTestCaseSetUpTearDownTest.test_tear_down_releases_app_and_http_server.<locals>.SetUpTearDown.test�s@�������f� 5� 5�6�6�6������m� <� <�=�=�=�=�=r-N)r.r/r0rRrqr1r-rr�r��s2������
%�
%�
%�
>�
>�
>�
>�
>r-r�rqr�r�)rjrkrrl�assertFalser�)r'rrr�rqs    r�+test_tear_down_releases_app_and_http_serverzNAsyncHTTPTestCaseSetUpTearDownTest.test_tear_down_releases_app_and_http_server�s����$�&�&��	>�	>�	>�	>�	>�-�	>�	>�	>��}�V�$�$��������������v�.�.�/�/�/������}�5�5�6�6�6�6�6r-N)r.r/r0r�r1r-rr�r��s#������7�7�7�7�7r-r�c���eZdZ�fd�Z�fd�Zed���Zed���Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Z�xZS)
�GenTestc�V��t�����d|_dS)NF)r5rH�finishedr9s �rrHz
GenTest.setUp�s���
���
�
������
�
�
r-c�|��|�|j��t�����dSr)r�r�r5r6r9s �rr6zGenTest.tearDown�s3�������
�&�&�&�
���������r-c��d|_dS�NT�r�r+s r�	test_synczGenTest.test_sync�s
����
�
�
r-c#�4K�tjV�d|_dSr�)r�momentr�r+s r�
test_asynczGenTest.test_async�s�����j������
�
�
r-c��td���d���}	||��|�d��n<#tj$r*|�dtj����YnwxYwd|_dS)Nr*rc3�6K�tjd��V�dS�Nr�r�sleepr+s rrqz"GenTest.test_timeout.<locals>.test�� �����)�A�,�,�����r-�did not get expected exceptionzgen.sleep(1)T)r�failr�TimeoutErrorro�	traceback�
format_excr��r'rqs  r�test_timeoutzGenTest.test_timeout�s���	�#�	�	�	�	�	�
�	�	�
	B��D��J�J�J��I�I�6�7�7�7�7���"�	B�	B�	B�
�M�M�.�)�*>�*@�*@�A�A�A�A�A�	B����
��
�
�
s� <�6A5�4A5c�\�td���d���}||��d|_dS)Nrrc3�6K�tjd��V�dS)Nr*r�r+s rrqz%GenTest.test_no_timeout.<locals>.tests �����)�C�.�.� � � � � r-T�rr�r�s  r�test_no_timeoutzGenTest.test_no_timeoutsA��	�!�	�	�	�	!�	!�
�	�	!�	
��T�
�
�
���
�
�
r-c��td���d���}tdd��5||��ddd��n#1swxYwYd|_dS)Ng�?rc3�6K�tjd��V�dS)Ng�?r�r+s r�test_long_timeoutzDGenTest.test_timeout_environment_variable.<locals>.test_long_timeouts �����)�D�/�/�!�!�!�!�!r-r�0.1T)rrr�)r'r�s  r�!test_timeout_environment_variablez)GenTest.test_timeout_environment_variables���	�#�	�	�	�	"�	"�
�	�	"��-�u�
5�
5�	$�	$���d�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$���
�
�
s�A�A�	Ac��td���d���}tdd��5|�tj��5||��ddd��n#1swxYwYddd��n#1swxYwYd|_dS)Nrrc3�6K�tjd��V�dSr�r�r+s r�test_short_timeoutzHGenTest.test_no_timeout_environment_variable.<locals>.test_short_timeout$r�r-rr�T)rrr%rr�r�)r'r�s  r�$test_no_timeout_environment_variablez,GenTest.test_no_timeout_environment_variable#s��	�$�	�	�	�	�	�
 �	�	��-�u�
5�
5�	)�	)��"�"�6�#6�7�7�
)�
)�"�"�4�(�(�(�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)���
�
�
s5� A9�
A"�A9�"A&	�&A9�)A&	�*A9�9A=�A=c�L�td���}||d��d|_dS)Nc7�RK�|�|d��tjV�dS)N�rq)rUrr�)r'�argss  r�test_with_argsz5GenTest.test_with_method_args.<locals>.test_with_args0s0�������T�9�-�-�-��*�����r-rqTr�)r'r�s  r�test_with_method_argszGenTest.test_with_method_args/s:��	�	�	�
��	�	��t�V�$�$�$���
�
�
r-c�N�td���}||d���d|_dS)Nc;�VK�|�|ddi��tjV�dSr�)�assertDictEqualrr�)r'�kwargss  r�test_with_kwargsz9GenTest.test_with_method_kwargs.<locals>.test_with_kwargs9s5����� � ��&�&�)9�:�:�:��*�����r-rqr�Tr�)r'r�s  r�test_with_method_kwargszGenTest.test_with_method_kwargs8s>��	�	�	�
��	�	���F�+�+�+�+���
�
�
r-c�<�td���}||��dS)Nc��K�d|_dSr�r�r+s rrqz+GenTest.test_native_coroutine.<locals>.testBs���� �D�M�M�Mr-)rr�s  r�test_native_coroutinezGenTest.test_native_coroutineAs.��	�	!�	!�
��	!�	
��T�
�
�
�
�
r-c��td���d���}	||��|�d��dS#tj$rd|_YdSwxYw)Nr*rc��>K�tjd���d{V��dSr�r�r+s rrqz3GenTest.test_native_coroutine_timeout.<locals>.testJs,�����)�A�,�,���������r-r�T)rr�rr�r�r�s  r�test_native_coroutine_timeoutz%GenTest.test_native_coroutine_timeoutHs}��	�#�	�	�	�	�	�
�	�	�	!��D��J�J�J��I�I�6�7�7�7�7�7���"�	!�	!�	!� �D�M�M�M�M�	!���s� =�A�A)r.r/r0rHr6rr�r�r�r�r�r�r�r�r�r�rCrDs@rr�r��s����������������������X������X�����$���	�	�	�
�
�
����������
!�
!�
!�
!�
!�
!�
!r-r�c�4��eZdZd�Z�fd�Z�fd�Zd�Z�xZS)�GetNewIOLoopTestc�>�tj���Sr)r�IOLoop�currentr+s r�get_new_ioloopzGetNewIOLoopTest.get_new_ioloopVs���}�$�$�&�&�&r-c�X��t��5	tj��|_n#t$r
d|_YnwxYwddd��n#1swxYwYtj��|_tj|j��t���	��dSr)
rr=�get_event_loop�	orig_loop�RuntimeError�new_event_loop�new_loop�set_event_loopr5rHr9s �rrHzGetNewIOLoopTest.setUpZs���� �
!�
!�	&�	&�
&�!(�!7�!9�!9������
&�
&�
&�!%�����
&����	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�
 �.�0�0��
���t�}�-�-�-�
���
�
�����s,�A�+�A�?�A�?�A�A�Ac���t�����|�tj�������tj|j��|j�	��dSr)
r5r6r�r=r��	is_closedrr�r��closer9s �rr6zGetNewIOLoopTest.tearDownfso���
������������/�1�1�;�;�=�=�>�>�>���t�~�.�.�.��
�������r-c�P�|�|jj|j��dSr)r�r �asyncio_loopr�r+s r�	test_loopzGetNewIOLoopTest.test_loopms#���
�
�d�l�/���?�?�?�?�?r-)r.r/r0r�rHr6rrCrDs@rr�r�Usv�������'�'�'�
�
�
�
�
������@�@�@�@�@�@�@r-r��__main__)&�tornadorr�tornado.httpserverr�
tornado.locksr�tornado.test.utilr�tornado.testingrr	r
r�tornado.webr
r=�
contextlibr�r7rr�r�rjr|�contextmanagerrrr3rFr�rar�r�r�r�r.�mainr1r-r�<module>rs�����������)�)�)�)�)�)�������0�0�0�0�0�0�X�X�X�X�X�X�X�X�X�X�X�X�#�#�#�#�#�#�������������	�	�	�	�	�	�	�	�������������������
)�
)���
)������
����B�����}����0�����-����@@
�@
�@
�@
�@
�x�0�@
�@
�@
�F+�+�+�+�+��)�+�+�+�:7�7�7�7�7��):�7�7�7�$g!�g!�g!�g!�g!�m�g!�g!�g!�T@�@�@�@�@�}�@�@�@�8�z����H�M�O�O�O�O�O��r-

Youez - 2016 - github.com/yon3zu
LinuXploit