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__/options_test.cpython-311.pyc
�

��b�-����ddlZddlmZddlZddlZddlmZddlZddlmZm	Z	ddl
mZddlm
Z
ddlZejrddlmZGd�d	e��ZGd
�dej��ZdS)�N)�StringIO)�mock)�OptionParser�Error)�basestring_type)�subTest)�Listc�*�eZdZd�Zed���ZdS)�Emailc�b�t|t��r
d|vr	||_dSt���)N�@)�
isinstance�str�_value�
ValueError)�self�values  �;/usr/lib/python3/dist-packages/tornado/test/options_test.py�__init__zEmail.__init__s1���e�S�!�!�	�c�U�l�l��D�K�K�K��,�,��c��|jS�N)r�rs rrzEmail.values
���{�rN)�__name__�
__module__�__qualname__r�propertyr�rrrrs>�������������X���rrc��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�OptionsTestc��t��}|�dd���|�ddg��|�|jd��dS)N�port�P��default�main.pyz
--port=443�)r�define�parse_command_line�assertEqualr"�r�optionss  r�test_parse_command_linez#OptionsTest.test_parse_command_linesX���.�.�����v�r��*�*�*��"�"�I�|�#<�=�=�=������s�+�+�+�+�+rc�2�t��}|�dd���|�dd���|�d��tj�tj�tj�t����d��}|�|��|�	|j
d��|�	|jd	��|�	|j|��dS)
Nr"r#r$�username�foo�my_path�options_test.cfgr'u李康)
rr(�os�path�join�dirname�abspath�__file__�parse_config_filer*r"r/r1)rr,�config_paths   r�test_parse_config_filez"OptionsTest.test_parse_config_file%s����.�.�����v�r��*�*�*����z�5��1�1�1����y�!�!�!��g�l�l��G�O�O�B�G�O�O�H�5�5�6�6�8J�
�
��	�!�!�+�.�.�.������s�+�+�+�����)�8�4�4�4������+�6�6�6�6�6rc���t��}d�_�fd�}|�|��|�dgd������j��|�dg�����j��d�_|�dg�����j��dS)NFc���d�_dS)NT)�calledrs�r�callbackz2OptionsTest.test_parse_callbacks.<locals>.callback6s����D�K�K�Krr&)�final)rr>�add_parse_callbackr)�assertFalse�
assertTrue)rr,r?s`  r�test_parse_callbacksz OptionsTest.test_parse_callbacks2s�����.�.�����	�	�	�	�	�	�"�"�8�,�,�,�	�"�"�I�;�e�"�<�<�<������%�%�%�	�"�"�I�;�/�/�/������$�$�$�����"�"�I�;�/�/�/������$�$�$�$�$rc��t��}	tj}t��t_|�t
��5|�ddg��ddd��n#1swxYwYtj���}|t_n#|t_wxYw|�d|��dS)Nr&z--helpzUsage:)	r�sys�stderrr�assertRaises�
SystemExitr)�getvalue�assertIn)rr,�orig_stderr�usages    r�	test_helpzOptionsTest.test_helpIs����.�.��	%��*�K�!���C�J��"�"�:�.�.�
B�
B��*�*�I�x�+@�A�A�A�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B����
B�
B�
B�
B��J�'�'�)�)�E�$�C�J�J���C�J�$�$�$�$��
�
�h��&�&�&�&�&s/�>B(�A2�&B(�2A6�6B(�9A6�:!B(�(B6c���t��}|�dd���t��}|�dt���|�gd���}|�|ddg��|�|j��|�|��}|�|g��|�|jd	��	tj	}t��t_	|�t��5|�dd
g��ddd��n#1swxYwY|t_	dS#|t_	wxYw)N�verboseFr$r0��type)r&�	--verbose�
subcommand�	--foo=barrTrU�barrS)
rr(rr)r*rCrPr0rFrGrrHr)r�base_options�sub_options�rest�rest2rLs      r�test_subcommandzOptionsTest.test_subcommandUs���#�~�~�����I�u��5�5�5�"�n�n�����5�s��+�+�+��.�.�?�?�?�
�
��	
�����k�:�;�;�;�����,�-�-�-��.�.�t�4�4�������#�#�#������%�0�0�0�	%��*�K�!���C�J��"�"�5�)�)�
L�
L��.�.��k�/J�K�K�K�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L����
L�
L�
L�
L�%�C�J�J�J���C�J�$�$�$�$s0� >E�E�6E�E�E�	E�
E�E)c��t��}|�ddt���d|_|�|jd��dS�Nr0��r%rR�)rr(�intr0r*r+s  r�test_setattrzOptionsTest.test_setattrlsH���.�.�����u�a�c��2�2�2���������a�(�(�(�(�(rc���t��}|�ddt���|�t��5d|_ddd��dS#1swxYwYdS)Nr0r^r_�2)rr(rarHrr0r+s  r�test_setattr_type_checkz#OptionsTest.test_setattr_type_checkrs����.�.�����u�a�c��2�2�2�
�
�
�u�
%�
%�	�	��G�K�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�"Ac��g}t��}|�ddt|j���d|_|�|dg��dS)Nr0r^)r%rRr?r`)rr(ra�appendr0r*)r�valuesr,s   r�test_setattr_with_callbackz&OptionsTest.test_setattr_with_callbackzsQ�����.�.�����u�a�c�F�M��J�J�J��������!��%�%�%�%�%rc�~�t��}|�dd���|�dd���|S)N�ar^r$�br`)rr(r+s  r�_sample_optionszOptionsTest._sample_options�s<���.�.�����s�A��&�&�&����s�A��&�&�&��rc��|���}|�tgd���tt|������dS)N�rkrl�help)rmr*�set�iterr+s  r�	test_iterzOptionsTest.test_iter�sL���&�&�(�(������/�/�/�0�0�#�d�7�m�m�2D�2D�E�E�E�E�Erc�f�|���}|�d|d��dS)Nr^rk)rmr*r+s  r�test_getitemzOptionsTest.test_getitem�s3���&�&�(�(������G�C�L�)�)�)�)�)rc��t��}|�ddt���d|d<|�|dd��dSr])rr(rar*r+s  r�test_setitemzOptionsTest.test_setitem�sL���.�.�����u�a�c��2�2�2������������+�+�+�+�+rc��|���}ddd|jfg}t|�����}|�||��dS)N)rkr^)rlr`rp)rmrp�sorted�itemsr*)rr,�expected�actuals    r�
test_itemszOptionsTest.test_items�sW���&�&�(�(���h����(>�?����
�
���(�(������6�*�*�*�*�*rc��|���}dd|jd�}|�||�����dS)Nr^r`ro)rmrpr*�as_dict)rr,r{s   r�test_as_dictzOptionsTest.test_as_dict�sJ���&�&�(�(����G�L�9�9������7�?�?�#4�#4�5�5�5�5�5rc���t��}|�dd���|�ddd���tjd��}|jj}|�tdd	|g��|�����|�	d��}|�ddi|��|�i|�	d
����dS)Nrkr^r$rl�b_groupr`)�groupr%r��nonexistent)
rr(rF�	_getframe�f_code�co_filenamer*rq�groups�
group_dict)rr,�frame�	this_file�b_group_dicts     r�test_group_dictzOptionsTest.test_group_dict�s����.�.�����s�A��&�&�&����s�)�Q��7�7�7��
�a� � ���L�,�	�����i��Y�7�8�8�'�.�.�:J�:J�K�K�K��)�)�)�4�4�����#�q��<�0�0�0�����W�/�/�
�>�>�?�?�?�?�?rc��t��}|�dd���|�ddg��|�|jd��t
j�|���dd��5|�|jd��ddd��n#1swxYwY|�|jd��t
j�|���dd��5|�|jd��d	|_|�|jd	��t
j�|���dd
��5|�|jd
��ddd��n#1swxYwY|�|jd	��ddd��n#1swxYwY|�|jd��dS)Nr0r^r$r&z--foo=2r`����)	rr(r)r*r0r�patch�object�mockabler+s  r�test_mock_patchzOptionsTest.test_mock_patch�s|���.�.�����u�a��(�(�(��"�"�I�y�#9�:�:�:������a�(�(�(�
�Z�
�
�w�/�/�1�1�5�!�
<�
<�	-�	-����W�[�!�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-������a�(�(�(��Z�
�
�w�/�/�1�1�5�!�
<�
<�	-�	-����W�[�!�,�,�,��G�K����W�[�!�,�,�,���"�"�7�#3�#3�#5�#5�u�a�@�@�
1�
1�� � ���a�0�0�0�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1����W�[�!�,�,�,�
	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	
�����a�(�(�(�(�(sI�B3�3B7�:B7�A1G�=F%�G�%F)	�)G�,F)	�-G�G�Gc��t��}|�dt���|�dt���|�dt���|�dt
���|�dtj���|�dtj���|�dt���|�d	td
���|S)NrrQ�
basestringra�float�datetime�	timedelta�emailzlist-of-intT�rR�multiple)	rr(rrrar�r�r�rr+s  r�_define_optionszOptionsTest._define_options�s����.�.�����u�3��'�'�'����|�/��:�:�:����u�3��'�'�'����w�U��+�+�+����z��(9��:�:�:����{��);��<�<�<����w�U��+�+�+����}�3���>�>�>��rc
�p�|�|jd��|�|jd��|�|jd��|�|jd��|�|jtjddddd	����|�|jtjd
�����|�|jjd��|�	t|jt����|�|jgd
���dS)N�asdf�qwer�*g�?i�r��r���-)�secondsztornado@web.com)r^r`r�)
r*rr�rar�r�r�r�rrCrr�list_of_intr+s  r�_check_options_valuesz!OptionsTest._check_options_values�s�������f�-�-�-�����+�V�4�4�4������b�)�)�)�������,�,�,�����)�8�+<�T�1�b�!�R�+P�+P�Q�Q�Q�����*�H�,>�r�,J�,J�,J�K�K�K������,�.?�@�@�@����
�7�=�%�8�8�9�9�9�����,�i�i�i�8�8�8�8�8rc��|���}|�gd���|�|��dS)N)	r&z
--str=asdfz--basestring=qwerz--int=42z--float=1.5z--datetime=2013-04-28 05:16z--timedelta=45sz--email=tornado@web.comz--list-of-int=1,2,3)r�r)r�r+s  r�
test_typeszOptionsTest.test_types�sV���&�&�(�(���"�"�

�

�

�	
�	
�	
�	
�"�"�7�+�+�+�+�+rc��dD]�}|���}|�tj�tj�t��|����|�|����dS)N)zoptions_test_types.cfgzoptions_test_types_str.cfg)r�r9r3r4r5r6r8r�)r�config_file_namer,s   r�test_types_with_conf_filez%OptionsTest.test_types_with_conf_file�s���!
�	0�	0���*�*�,�,�G��%�%�����R�W�_�_�X�6�6�8H�I�I�
�
�
�
�&�&�w�/�/�/�/�	0�	0rc���t��}|�dtd���|�ddg��|�|jgd���dS)Nr0Tr�r&z--foo=a,b,c)rkrl�c)rr(rr)r*r0r+s  r�test_multiple_stringz OptionsTest.test_multiple_string�s^���.�.�����u�3���6�6�6��"�"�I�}�#=�>�>�>������o�o�o�6�6�6�6�6rc���t��}|�dtd���|�ddg��|�|jgd���dS)Nr0Tr�r&z
--foo=1,3,5:7)r^r�r�r��)rr(rar)r*r0r+s  r�test_multiple_intzOptionsTest.test_multiple_int�s^���.�.�����u�3���6�6�6��"�"�I��#?�@�@�@������o�o�o�6�6�6�6�6rc�*�t��}|�d��|�t��5}|�d��ddd��n#1swxYwY|�t|j��d��dS)Nr0zOption.*foo.*already defined)rr(rHr�assertRegexr�	exception)rr,�cms   r�test_error_redefinezOptionsTest.test_error_redefines����.�.�����u����
�
�
�u�
%�
%�	"���N�N�5�!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�����R�\�*�*�,J�K�K�K�K�Ks�A � A$�'A$c��gd�}|D]�\}}t|||���5t��}|�|��|�t��5}|�|��ddd��n#1swxYwY|�t
|j��d��ddd��n#1swxYwY��dS)N))�foo-barr�)�foo_barr��r�r�)r�r�)rkrlz Option.*foo.bar.*already defined)rrr(rHrr�rr�)r�testsrkrlr,r�s      r�test_error_redefine_underscorez*OptionsTest.test_error_redefine_underscoresf��
�
�
���	X�	X�D�A�q����a�(�(�(�
X�
X�&�.�.�����q�!�!�!��&�&�u�-�-�&���N�N�1�%�%�%�&�&�&�&�&�&�&�&�&�&�&����&�&�&�&�� � ��R�\�!2�!2�4V�W�W�W�
X�
X�
X�
X�
X�
X�
X�
X�
X�
X�
X����
X�
X�
X�
X��	X�	Xs5�>B=�A>�2B=�>B�B=�B�+B=�=C	�C	c�4�dD]�}dD]�}t��}|�|��|�d|g��|�|jd��|�|dd��|�|dd������dS)Nr�)z--foo-bar=az--foo_bar=ar&rkr�r�)rr(r)r*r�)r�defined_name�flagr,s    r�test_dash_underscore_cliz$OptionsTest.test_dash_underscore_clis���2�		:�		:�L�6�
:�
:��&�.�.�����|�,�,�,��*�*�I�t�+<�=�=�=�� � ���#�6�6�6�� � ���!3�S�9�9�9�� � ���!3�S�9�9�9�9�
:�		:�		:rc�6�dD]�}t��}|�|��|�tj�tj�t��d����|�|j	d����dS)Nr�r2rk)
rr(r9r3r4r5r6r8r*r�)rr�r,s   r�test_dash_underscore_filez%OptionsTest.test_dash_underscore_file)s���3�	3�	3�L�"�n�n�G��N�N�<�(�(�(��%�%�����R�W�_�_�X�6�6�8J�K�K�
�
�
�
���W�_�c�2�2�2�2�
	3�	3rc�.�t��}|�dd���|�dd���gd�}|�t|��|��|�td�|���D����|��|�t|��������|��|�t|�d����ddg��t��}|�	|��|�
d|�����|�
d|�����dS)	N�	with-dash�g)r��with_underscore)rpr�r�c3� K�|]	\}}|V��
dSrr)�.0�k�vs   r�	<genexpr>zAOptionsTest.test_dash_underscore_introspection.<locals>.<genexpr>;s&����@�@�f�q�!��@�@�@�@�@�@rz--with-dashz--with-underscore)rr(r*ryrzr�keysr�r�
print_helprKrJ)rr,�all_options�bufs    r�"test_dash_underscore_introspectionz.OptionsTest.test_dash_underscore_introspection4s_���.�.�����{�#��.�.�.����(���4�4�4�>�>�>���������+�6�6�6�����@�@��
�
���@�@�@�@�@�+�N�N�N�������� 1� 1� 6� 6� 8� 8�9�9�;�G�G�G�����7�%�%�c�*�*�+�+�k�;L�-M�	
�	
�	
�
�j�j�����3�����
�
�m�S�\�\�^�^�4�4�4��
�
�)�3�<�<�>�>�:�:�:�:�:rN)rrrr-r;rDrNr[rbrerirmrsrurwr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr r s�������,�,�,�7�7�7�%�%�%�.
'�
'�
'�%�%�%�.)�)�)����&�&�&����F�F�F�
*�*�*�,�,�,�+�+�+�6�6�6�
@�@�@�)�)�)�*
�
�
�	9�	9�	9�,�,�,�"	0�	0�	0�7�7�7�7�7�7�L�L�L�X�X�X�":�:�:�	3�	3�	3�;�;�;�;�;rr )r��iorr3rF�unittestr�tornado.optionsrr�tornado.utilr�tornado.test.utilr�typing�
TYPE_CHECKINGr	r�r�TestCaser rrr�<module>r�s������������	�	�	�	�
�
�
�
�����������/�/�/�/�/�/�/�/�(�(�(�(�(�(�%�%�%�%�%�%�
�
�
�
�	���������	�	�	�	�	�F�	�	�	�h;�h;�h;�h;�h;�(�#�h;�h;�h;�h;�h;r

Youez - 2016 - github.com/yon3zu
LinuXploit