403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/traitlets/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/traitlets/tests/__pycache__/test_traitlets_enum.cpython-311.pyc
�

�Uc�4�� �dZddlZddlZddlmZmZmZmZmZm	Z	Gd�dej��Z
Gd�dej��ZGd�d	ej��Zd
�
��ZGd�dej��ZGd
�dej��ZdS)z"
Test the trait-type ``UseEnum``.
�N)�CaselessStrEnum�Enum�	FuzzyEnum�	HasTraits�
TraitError�UseEnumc��eZdZdZdZdZdZdS)�Color����N)�__name__�
__module__�__qualname__�red�green�blue�yellow���E/usr/lib/python3/dist-packages/traitlets/tests/test_traitlets_enum.pyr
r
�"������
�C�
�E��D�
�F�F�Frr
c��eZdZdZdZdS)�
OtherColorrrN)rrrrrrrrrrs������
�C�
�E�E�Errc��eZdZdZdZdZdZdS)�CSColorrrr
rN)rrrr�Green�BLUE�YeLLoWrrrrrrrrzred Green  BLUE YeLLoWc��eZdZGd�de��Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestUseEnumc�(�eZdZeed���ZdS)�TestUseEnum.Example�
Color enum��helpN�rrrrr
�colorrrr�Exampler$,s"���������L�1�1�1���rr*c��|���}tj|_|�|jtj��dS�N)r*r
rr)�assertEqual��self�examples  r�test_assign_enum_valuez"TestUseEnum.test_assign_enum_value/s8���,�,�.�.�����
��������4�4�4�4�4rc�8�d�tj���D��}|D]n}|�|t��|���}||_|�|j|��|�|t���odS)Nc��g|]}|��Srr)�.0�values  r�
<listcomp>z;TestUseEnum.test_assign_all_enum_values.<locals>.<listcomp>6s��E�E�E��u�E�E�Er)r
�__members__�values�assertIsInstancer*r)r-)r/�enum_valuesr5r0s    r�test_assign_all_enum_valuesz'TestUseEnum.test_assign_all_enum_values4s���E�E�%�*;�*B�*B�*D�*D�E�E�E�� �	0�	0�E��!�!�%��/�/�/��l�l�n�n�G�!�G�M����W�]�E�2�2�2��!�!�%��/�/�/�/�	0�	0rc��|���}|�t��5tj|_ddd��dS#1swxYwYdSr,)r*�assertRaisesrrrr)r.s  r�4test_assign_enum_value__with_other_enum_raises_errorz@TestUseEnum.test_assign_enum_value__with_other_enum_raises_error>s����,�,�.�.��
�
�
�z�
*�
*�	-�	-�&�,�G�M�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	-�	-s�A�A�Ac��|���}d|_|�|jtj��dS)Nr)r*r)r-r
rr.s  r�test_assign_enum_name_1z#TestUseEnum.test_assign_enum_name_1Cs6���,�,�.�.����
�������	�2�2�2�2�2rc��d�tj���D��}|D]�}|�|t��|���}tj�|��}||_|�|j|��|�	|jj
|����dS)Nc��g|]	}|j��
Sr)�name�r4�enum_vals  rr6z;TestUseEnum.test_assign_enum_value_name.<locals>.<listcomp>Ls��O�O�O��h�m�O�O�Or)r
r7r8r9�strr*�getr)�assertIsr-rC)r/�
enum_namesr5r0�
enum_values     r�test_assign_enum_value_namez'TestUseEnum.test_assign_enum_value_nameIs���P�O�E�4E�4L�4L�4N�4N�O�O�O�
��	8�	8�E��!�!�%��-�-�-��l�l�n�n�G��*�.�.�u�5�5�J�!�G�M��M�M�'�-��4�4�4����W�]�/��7�7�7�7�
	8�	8rc���gd�}|D]e}|���}||_|�|jt��|�t|j��|���fdS)N)z	Color.redzColor.greenz
Color.bluezColor.yellow)r*r)r9r
r-rF)r/�scoped_namesr5r0s    r�"test_assign_scoped_enum_value_namez.TestUseEnum.test_assign_scoped_enum_value_nameUsu��Q�Q�Q��!�	8�	8�E��l�l�n�n�G�!�G�M��!�!�'�-��7�7�7����S���/�/��7�7�7�7�		8�	8rc��gd�}|D]O}|���}|�t��5||_ddd��n#1swxYwY�PdS)N)�
UNKNOWN_COLOR�REDr�blue2)r*r=rr))r/�bad_enum_namesr5r0s    r�-test_assign_bad_enum_value_name__raises_errorz9TestUseEnum.test_assign_bad_enum_value_name__raises_error^s���C�C�C��#�	&�	&�E��l�l�n�n�G��"�"�:�.�.�
&�
&� %��
�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&��	&�	&s�A�A	�A	c��|���}d|_tjj|_|�|jtj��dS)Nr)r*r)r
rr5r-r.s  r�test_assign_enum_value_number_1z+TestUseEnum.test_assign_enum_value_number_1fsA���,�,�.�.����
��	���
�������	�2�2�2�2�2rc�L�d�tj���D��}|D]x}|�|t��|���}||_|�|jt��|�|jj|���ydS)Nc��g|]	}|j��
Sr)r5rDs  rr6z=TestUseEnum.test_assign_enum_value_number.<locals>.<listcomp>ps��R�R�R�8���R�R�Rr)	r
r7r8r9�intr*r)r-r5)r/�enum_numbersr5r0s    r�test_assign_enum_value_numberz)TestUseEnum.test_assign_enum_value_numberms���S�R�u�7H�7O�7O�7Q�7Q�R�R�R��!�	9�	9�E��!�!�%��-�-�-��l�l�n�n�G�!�G�M��!�!�'�-��7�7�7����W�]�0�%�8�8�8�8�	9�	9rc�<�gd�}|D]�}|�|t��tt���|d���J�|���}|�t��5||_ddd��n#1swxYwY��dS)N)���r�)	r9rYrr
�select_by_numberr*r=rr))r/�bad_numbersr5r0s    r�/test_assign_bad_enum_value_number__raises_errorz;TestUseEnum.test_assign_bad_enum_value_number__raises_errorxs��� �j�j�� �	&�	&�E��!�!�%��-�-�-��5�>�>�2�2�5�$�?�?�G�G�G��l�l�n�n�G��"�"�:�.�.�
&�
&� %��
�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&��		&�	&s�<B�B	�B	c��Gd�dt��}|��}|�|jtj��dS)Nc�$�eZdZee��ZdS)�=TestUseEnum.test_ctor_without_default_value.<locals>.Example2Nr(rrr�Example2rd�s�������G�E�N�N�E�E�Erre)rr-r)r
r�r/rer0s   r�test_ctor_without_default_valuez+TestUseEnum.test_ctor_without_default_value�sY��	#�	#�	#�	#�	#�y�	#�	#�	#��(�*�*��������	�2�2�2�2�2rc��Gd�dt��}|��}|�|jtj��dS)Nc�2�eZdZeeej���ZdS)�HTestUseEnum.test_ctor_with_default_value_as_enum_value.<locals>.Example2��
default_valueN)rrrrr
rr)rrrrerj�s$�������G�E���=�=�=�E�E�Erre)rr-r)r
rrfs   r�*test_ctor_with_default_value_as_enum_valuez6TestUseEnum.test_ctor_with_default_value_as_enum_value�sY��	>�	>�	>�	>�	>�y�	>�	>�	>��(�*�*���������4�4�4�4�4rc���Gd�dt��}|��}|�|jtj��|�|jtj��dS)Nc�D�eZdZeedd���Zeed���ZdS)�RTestUseEnum.test_ctor_with_default_value_none_and_not_allow_none.<locals>.Example2NF�rl�
allow_nonerk�rrrrr
�color1�color2rrrrerp�s8�������W�U�$�5�I�I�I�F��W�U�$�7�7�7�F�F�Frre)rr-rtr
rrurfs   r�4test_ctor_with_default_value_none_and_not_allow_nonez@TestUseEnum.test_ctor_with_default_value_none_and_not_allow_none�ss��	8�	8�	8�	8�	8�y�	8�	8�	8��(�*�*���������3�3�3��������3�3�3�3�3rc��Gd�dt��}|��}|�|jd��|�|jd��dS)Nc�D�eZdZeedd���Zeed���ZdS)�NTestUseEnum.test_ctor_with_default_value_none_and_allow_none.<locals>.Example2NTrq�rrrsrrrrery�s8�������W�U�$�4�H�H�H�F��W�U�t�4�4�4�F�F�Frre)rrHrtrurfs   r�0test_ctor_with_default_value_none_and_allow_nonez<TestUseEnum.test_ctor_with_default_value_none_and_allow_none�sk��	5�	5�	5�	5�	5�y�	5�	5�	5��(�*�*���
�
�g�n�d�+�+�+��
�
�g�n�d�+�+�+�+�+rc���Gd�dt��}|��}d|_d|_|�|jtj��|�|jtj��dS)Nc�>�eZdZeed���Zee��ZdS)�YTestUseEnum.test_assign_none_without_allow_none_resets_to_default_value.<locals>.Example2FrzNrsrrrrer~�s/�������W�U�u�5�5�5�F��W�U�^�^�F�F�Frre)rrtrurHr
rrfs   r�;test_assign_none_without_allow_none_resets_to_default_valuezGTestUseEnum.test_assign_none_without_allow_none_resets_to_default_value�s}��	$�	$�	$�	$�	$�y�	$�	$�	$��(�*�*���������
�
�g�n�e�i�0�0�0��
�
�g�n�e�i�0�0�0�0�0rc��Gd�dt��}|��}d|_|�|jd��dS)Nc�(�eZdZeed���ZdS)�>TestUseEnum.test_assign_none_to_enum_or_none.<locals>.Example2TrzNr(rrrrer���"�������G�E�d�3�3�3�E�E�Erre)rr)rHrfs   r� test_assign_none_to_enum_or_nonez,TestUseEnum.test_assign_none_to_enum_or_none�s\��	4�	4�	4�	4�	4�y�	4�	4�	4��(�*�*����
��
�
�g�m�T�*�*�*�*�*rc��Gd�dt��}|��}|�t��5d|_ddd��dS#1swxYwYdS)Nc�(�eZdZeed���ZdS)�HTestUseEnum.test_assign_bad_value_with_to_enum_or_none.<locals>.Example2TrzNr(rrrrer��r�rre�	BAD_VALUE)rr=rr)rfs   r�*test_assign_bad_value_with_to_enum_or_nonez6TestUseEnum.test_assign_bad_value_with_to_enum_or_none�s���	4�	4�	4�	4�	4�y�	4�	4�	4��(�*�*��
�
�
�z�
*�
*�	(�	(�'�G�M�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s�A
�
A�Ac����t�G�fd�dt��}tdd��D�]B}d|z}t||��}d|_|j��}|�t|�d����t���|�d����|�	d|��|j
��}|�t|�d	����t���|�d	����|�	d
|��|�|d��d|_|j��}|�t|�d����t���|�d����|�d
|��|j
��}|�t|�d	����t���|�d	����|�d
|��|�|d����DdS)Nc�x��eZdZe�d���Ze�d���Ze�d���Ze	e
d���ZdS)�&TestUseEnum.test_info.<locals>.ExampleFrzN)rrrr�enum1r�enum2r�enum3rr�enum4)�choicess�rr*r��s_��������D��U�3�3�3�E�#�O�G��>�>�>�E��I�g�%�8�8�8�E��G�G��6�6�6�E�E�Err*rr^zenum%sTz, zor None�|z	or `None`z\b\\\bF�None)
�
color_choicesr�range�getattrrr�infor-�len�split�assertIn�info_rst�assertNotRegex�assertNotIn)r/r*�i�attr�enumr�r�s      @r�	test_infozTestUseEnum.test_info�s,�����	7�	7�	7�	7�	7�	7�	7�i�	7�	7�	7��q�!���	1�	1�A��a�<�D��7�D�)�)�D�"�D�O��4�9�;�;�D����S����D�!1�!1�2�2�C��L�L�$�*�*�T�BR�BR�S�S�S��M�M�)�T�*�*�*� �4�=�?�?�D����S����C���1�1�3�w�<�<����C���Q�Q�Q��M�M�+�t�,�,�,�����i�0�0�0�#�D�O��4�9�;�;�D����S����D�!1�!1�2�2�C��L�L�$�*�*�T�BR�BR�S�S�S����V�T�*�*�*� �4�=�?�?�D����S����C���1�1�3�w�<�<����C���Q�Q�Q����V�T�*�*�*�����i�0�0�0�0�5	1�	1rN)rrrrr*r1r;r>r@rKrNrTrVr[rargrmrvr{rr�r�r�rrrr"r")sL������2�2�2�2�2�)�2�2�2�5�5�5�
0�0�0�-�-�-�
3�3�3�
8�
8�
8�8�8�8�&�&�&�3�3�3�	9�	9�	9�&�&�&�3�3�3�5�5�5�4�4�4�,�,�,�	1�	1�	1�+�+�+�(�(�(�#1�#1�#1�#1�#1rr"c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�
TestFuzzyEnumc��Gd�dt��}|��}tD]�}tdt|����D]�}|d|�}||_|�|j|��|���|_|�|j|��|���|_|�|j|������dS)Nc�(�eZdZeed���ZdS)�GTestFuzzyEnum.test_search_all_prefixes__overwrite.<locals>.FuzzyExampler%r&N�rrrrr�r)rrr�FuzzyExampler���"�������I�m�,�?�?�?�E�E�Err�r�rr�r�r�r)r-�upper�lower�r/r�r0r)�wlenr5s      r�#test_search_all_prefixes__overwritez1TestFuzzyEnum.test_search_all_prefixes__overwrite�s���	@�	@�	@�	@�	@�9�	@�	@�	@��,�.�.��"�	7�	7�E��a��U���,�,�

7�

7���e�t�e��� %��
�� � ����6�6�6� %���
�
��
�� � ����6�6�6� %���
�
��
�� � ����6�6�6�6�

7�	7�	7rc���Gd�dt��}tD]�}tdt|����D]�}|d|�}|��}||_|�|j|��|��}|���|_|�|j|��|��}|���|_|�|j|������dS)Nc�(�eZdZeed���ZdS)�BTestFuzzyEnum.test_search_all_prefixes__ctor.<locals>.FuzzyExampler%r&Nr�rrrr�r�r�rr�rr�)r/r�r)r�r5r0s      r�test_search_all_prefixes__ctorz,TestFuzzyEnum.test_search_all_prefixes__ctors��	@�	@�	@�	@�	@�9�	@�	@�	@�#�	7�	7�E��a��U���,�,�

7�

7���e�t�e���&�,�.�.�� %��
�� � ����6�6�6�&�,�.�.�� %���
�
��
�� � ����6�6�6�&�,�.�.�� %���
�
��
�� � ����6�6�6�6�

7�	7�	7rc��Gd�dt��}|��}tD]�}tdd��D]�}||d�}||_|�|j|��|���|_|�|j|��|���|_|�|j|������dS)Nc�*�eZdZeedd���ZdS)�ETestFuzzyEnum.test_search_substrings__overwrite.<locals>.FuzzyExampler%T�r'�substring_matchingNr�rrrr�r��%�������I�m�,�SW�X�X�X�E�E�Err�rr)rr�r�r)r-r�r�r�s      r�!test_search_substrings__overwritez/TestFuzzyEnum.test_search_substrings__overwrites���	Y�	Y�	Y�	Y�	Y�9�	Y�	Y�	Y��,�.�.��"�	7�	7�E��a����

7�

7���d�e�e��� %��
�� � ����6�6�6� %���
�
��
�� � ����6�6�6� %���
�
��
�� � ����6�6�6�6�

7�	7�	7rc��Gd�dt��}td}dt|��fD]�}tdt|��dz
��D]v}|||�}|��}||_|�|j|��|��}|���|_|�|j|���w��dS)Nc�*�eZdZeedd���ZdS)�@TestFuzzyEnum.test_search_substrings__ctor.<locals>.FuzzyExampler%Tr�Nr�rrrr�r�(r�rr�r]rr)rr�r�r�r)r-r�)r/r�r)�end�startr5r0s       r�test_search_substrings__ctorz*TestFuzzyEnum.test_search_substrings__ctor's���	Y�	Y�	Y�	Y�	Y�9�	Y�	Y�	Y��b�!����E�
�
�#�
	7�
	7�C��q�#�e�*�*�q�.�1�1�	
7�	
7���e�C�i�(��&�,�.�.�� %��
�� � ����6�6�6�&�,�.�.�� %���
�
��
�� � ����6�6�6�6�	
7�
	7�
	7rc��d�}|dd�����}|�t��5d|_ddd��n#1swxYwY|�t��5d|_ddd��n#1swxYwY|�t��5d|_ddd��n#1swxYwY|dd�����}|�t��5d|_ddd��n#1swxYwY|�t��5d|_ddd��n#1swxYwY|dd�����}|�t��5d|_ddd��n#1swxYwY|�t��5d|_ddd��n#1swxYwY|�t��5d	|_ddd��n#1swxYwY|�t��5d
|_ddd��n#1swxYwY|�t��5d|_ddd��n#1swxYwY|dd�����}|�t��5d|_ddd��n#1swxYwY|�t��5d|_ddd��dS#1swxYwYdS)Nc�6���G��fd�dt��}|S)Nc�,��eZdZee�����ZdS)�PTestFuzzyEnum.test_assign_other_raises.<locals>.new_trait_class.<locals>.Example��case_sensitiver�Nr�r�s��rr*r�:s.�������!�	�!�#1�'9������rr*�r)r�r�r*s`` r�new_trait_classz?TestFuzzyEnum.test_assign_other_raises.<locals>.new_trait_class9sD����
�
�
�
�
�
�
�
�)�
�
�
��NrFr��z	BAD COLOR�edT�Redr�lue�lUE)r=rr))r/r�r0s   r�test_assign_other_raisesz&TestFuzzyEnum.test_assign_other_raises8s���	�	�	�R�/�/��5�Q�Q�Q�S�S��
�
�
�z�
*�
*�	�	��G�M�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�
�
�z�
*�
*�	(�	(�'�G�M�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�
�
�
�z�
*�
*�	!�	!� �G�M�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�Q�/�/��%�P�P�P�R�R��
�
�
�z�
*�
*�	�	��G�M�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�
�
�z�
*�
*�	"�	"�!�G�M�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�P�/�/��$�O�O�O�Q�Q��
�
�
�z�
*�
*�	�	��G�M�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�
�
�z�
*�
*�	(�	(�'�G�M�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�
�
�
�z�
*�
*�	$�	$�#�G�M�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�
�
�
�z�
*�
*�	"�	"�!�G�M�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�
�
�
�z�
*�
*�	"�	"�!�G�M�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�Q�/�/��4�P�P�P�R�R��
�
�
�z�
*�
*�	�	��G�M�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�
�
�z�
*�
*�	(�	(�'�G�M�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s��A�A�A�,B�B�B�%B9�9B=�B=�3D�D�D�,E�E�E�:F�F�F�3G�G�G�,H�H�H�%H9�9H=�H=�I2�2I6�9I6�,K�K�K�%K:�:K>�K>c�~�d�}tD]t}||dd����}|�|j|��||���dd����}|�|j|���utd}||dd����}|�|j|��dS)Nc�:����G���fd�dt��}|S)Nc�.��eZdZee������ZdS)�TTestFuzzyEnum.test_ctor_with_default_value.<locals>.new_trait_class.<locals>.Example)rlr�r�Nr�)r�rlr�s���rr*r�es1�������!�	�!�"/�#1�'9�	�����rr*r�)rlr�r�r*s``` rr�zCTestFuzzyEnum.test_ctor_with_default_value.<locals>.new_trait_classdsJ�����
�
�
�
�
�
�
�
�
�)�
�
�
��NrFr]T)r�r-r)r�)r/r�r)r0s    r�test_ctor_with_default_valuez*TestFuzzyEnum.test_ctor_with_default_valuecs���		�		�		�#�	3�	3�E�:�o�o�e�U�E�:�:�<�<�G����W�]�E�2�2�2�B�o�o�e�k�k�m�m�U�E�B�B�D�D�G����W�]�E�2�2�2�2��b�!��5�/�/�%��u�5�5�7�7��������.�.�.�.�.rN)	rrrr�r�r�r�r�r�rrrr�r��so������7�7�7�$7�7�7�(7�7�7�$7�7�7�")(�)(�)(�V/�/�/�/�/rr�)�__doc__r��unittest�	traitletsrrrrrrr
rrr�r��TestCaser"r�rrr�<module>r�sa������������V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V������D�I��������������
�����d�i����)�.�.�0�0�
�z1�z1�z1�z1�z1�(�#�z1�z1�z1�DM/�M/�M/�M/�M/�H�%�M/�M/�M/�M/�M/r

Youez - 2016 - github.com/yon3zu
LinuXploit