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_unicodedata.cpython-312.pyc

�

'Μg
D��(�dZddlZddlmZddlZddlZddlZddlmZm	Z	m
Z
mZmZGd�dej�ZGd�dej�ZGd	�d
e�ZGd�de�ZGd
�dej�Zedk(rej(�yy)z� Tests for the unicodedata module.

    Written by Marc-Andre Lemburg (mal@lemburg.com).

    (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�
HTTPException)�open_urlresource�requires_resource�
script_helper�cpython_only�check_disallow_instantiationc�,�eZdZdZed�d��Zy)�UnicodeMethodsTest�(e708c31c0d51f758adf475cb7201cf80917362be�cpuc���tj�}ttjdz�D�]}t|�}d|j
�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d|dzj
�d|dzj�d|dzj�d|dzj�d|dzj�d|dzj�d|dzj�d|dzj�d|dzj�|j�|j!�|j#�|dzj�|dzj!�|dzj#�|dzj#�g}|j%dj'|�j)dd	����|j+�}|j-||j.�y)
N��01�abc�123z 	�ABC��utf-8�
surrogatepass)�hashlib�sha1�range�sys�
maxunicode�chr�isalnum�isalpha�	isdecimal�isdigit�islower�	isnumeric�isspace�istitle�isupper�lower�upper�title�update�join�encode�	hexdigest�assertEqual�expectedchecksum)�self�h�i�char�data�results      �2/usr/local/lib/python3.12/test/test_unicodedata.py�test_method_checksumz'UnicodeMethodsTest.test_method_checksums���L�L�N���s�~�~��)�*�A��q�6�D��T�\�\�^�$��T�\�\�^�$��T�^�^�%�&��T�\�\�^�$��T�\�\�^�$��T�^�^�%�&��T�\�\�^�$��T�\�\�^�$��T�\�\�^�$��d�U�l�+�+�-�.��d�U�l�+�+�-�.��d�U�l�-�-�/�0��d�U�l�+�+�-�.��d�U�l�+�+�-�.��d�U�l�-�-�/�0��d�U�l�+�+�-�.��d�U�l�+�+�-�.��d�U�l�+�+�-�.��
�
���
�
���
�
�����$�$�&����$�$�&����$�$�&����$�$�&�A"�D�F
�H�H�R�W�W�T�]�)�)�'�?�C�D�K+�L����������!6�!6�7�N)�__name__�
__module__�__qualname__r-rr5�r6r4r
r
s"��B���u��)8��)8r6r
c��eZdZeZy)�UnicodeDatabaseTestN)r7r8r9�unicodedata�dbr:r6r4r<r<Cs��	�Br6r<c��eZdZdZed�d��Zed�d��Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)�UnicodeFunctionsTest�(26ff0d31c14194b4606a5b3a81ac36df3a14e331rc��g}tj�}ttjdz�D�]q}t|�}t
|jj|d�d�t
|jj|d�d�t
|jj|d�d�|jj|�|jj|�|jj|�t|jj|��t|jj!|��t#j$|�|jj'|d�g
}|j)dj+|�j-d����t|j/�}|j1||j2�y)Nr���z.12gr�ascii)rrrrrr�formatr>�digit�numeric�decimal�category�
bidirectional�
decomposition�str�mirrored�	combiningr=�east_asian_width�namer(r)r*r+r,r-)r.r2r/r0r1r3s      r4�test_function_checksumz+UnicodeFunctionsTest.test_function_checksumLsO�����L�L�N���s�~�~��)�*�A��q�6�D��t�w�w�}�}�T�2�.��7��t�w�w���t�R�0�&�9��t�w�w���t�R�0�&�9���� � ��&����%�%�d�+����%�%�d�+��D�G�G�$�$�T�*�+��D�G�G�%�%�d�+�,��,�,�T�2������T�2�&��D�
�H�H�R�W�W�T�]�)�)�'�2�3�+� ����������!6�!6�7r6c���ttjdz�D]W}t|�}|jj|d�x}s�-|j
|jj|�|��Yy)Nr)rrrrr>rPr,�lookup)r.r0r1�looked_names    r4�test_name_inverse_lookupz-UnicodeFunctionsTest.test_name_inverse_lookupdsZ���s�~�~��)�*�A��q�6�D�"�g�g�l�l�4��6�6�{�6�� � �������!<�d�C�+r6c��|j|jjdd�d�|j|jjd�d�|j|jjdd�d�|j|jjd�d�|j|jjdd�d�|j|jjd�d�|jt|jj�|jt|jjd	�|jt
|jjd
�y�N�A�9�	�⅛�⑨�𠀀u𝟽��xx�x)r,r>rF�assertRaises�	TypeError�
ValueError�r.s r4�
test_digitzUnicodeFunctionsTest.test_digitks����������s�D�1�4�8���������s�+�Q�/���������x��6��=���������x�0�!�4���������|�T�:�D�A���������|�4�a�8����)�T�W�W�]�]�3����)�T�W�W�]�]�D�9����*�d�g�g�m�m�S�9r6c�b�|j|jjdd�d�|j|jjd�d�|j|jjd�d�|j|jjd�d�|j|jjd�d	�|j|jjd
d�d�|j|jjd�d�|jt|jj�|jt|jjd
�|jt
|jjd�y)NrXrYrZr[g�?r\g"@u꘧g@r]�𐄪i(#r_r`)r,r>rGrarbrcrds r4�test_numericz!UnicodeFunctionsTest.test_numericws�����������T�2�D�9����������-�q�1����������2�E�:����������2�C�8����������2�C�8����������t�<�d�C����������6��=����)�T�W�W�_�_�5����)�T�W�W�_�_�d�;����*�d�g�g�o�o�s�;r6c��|j|jjdd�d�|j|jjd�d�|j|jjdd�d�|j|jjdd�d�|j|jjdd�d�|j|jjd�d�|jt|jj�|jt|jjd	�|jt
|jjd
�yrW)r,r>rHrarbrcrds r4�test_decimalz!UnicodeFunctionsTest.test_decimal�s�����������T�2�D�9����������-�q�1����������4�8�$�?����������4�8�$�?����������t�<�d�C����������6��:����)�T�W�W�_�_�5����)�T�W�W�_�_�d�;����*�d�g�g�o�o�s�;r6c�\�|j|jjd�d�|j|jjd�d�|j|jjd�d�|j|jjd�d�|j|jjd	�d
�|jt|jj�|jt|jjd�y)N�￾�Cn�a�LlrX�Lur]�Lorg�Nor_)r,r>rIrarbrds r4�
test_categoryz"UnicodeFunctionsTest.test_category�s���������)�)�(�3�T�:�������)�)�#�.��5�������)�)�#�.��5�������)�)�,�7��>�������)�)�,�7��>����)�T�W�W�%5�%5�6����)�T�W�W�%5�%5�t�<r6c��|j|jjd�d�|j|jjd�d�|j|jjd�d�|j|jjd�d�|jt|jj�|jt|jjd�y)	Nrlr� �WSrX�Lr]r_)r,r>rJrarbrds r4�test_bidirectionalz'UnicodeFunctionsTest.test_bidirectional�s���������.�.�x�8�"�=�������.�.�s�3�T�:�������.�.�s�3�S�9�������.�.�|�<�c�B����)�T�W�W�%:�%:�;����)�T�W�W�%:�%:�D�Ar6c�Z�|j|jjd�d�|j|jjd�d�|jt|jj�|jt|jjd�y)Nrlr�¼z<fraction> 0031 2044 0034r_)r,r>rKrarbrds r4�test_decompositionz'UnicodeFunctionsTest.test_decomposition�sw��������.�.�x�8��<�������.�.�x�8�:U�V����)�T�W�W�%:�%:�;����)�T�W�W�%:�%:�D�Ar6c��|j|jjd�d�|j|jjd�d�|j|jjd�d�|j|jjd�d�|jt|jj�|jt|jjd�y)Nrlrrnu∁rr]r_)r,r>rMrarbrds r4�
test_mirroredz"UnicodeFunctionsTest.test_mirrored�s���������)�)�(�3�Q�7�������)�)�#�.��2�������)�)�(�3�Q�7�������)�)�,�7��;����)�T�W�W�%5�%5�6����)�T�W�W�%5�%5�t�<r6c��|j|jjd�d�|j|jjd�d�|j|jjd�d�|j|jjd�d�|jt|jj�|jt|jjd�y)Nrlrrnu⃡��r]r_)r,r>rNrarbrds r4�test_combiningz#UnicodeFunctionsTest.test_combining�s���������*�*�8�4�a�8�������*�*�3�/��3�������*�*�8�4�c�:�������*�*�<�8�!�<����)�T�W�W�%6�%6�7����)�T�W�W�%6�%6��=r6c�n�d}|D].}|j|jjd|�|��0y)N)uେ̀ାuᄀ̀ᅡuLi̍t-sṳ́u.मार्क ज़ुकेरबर्गu'किर्गिज़स्तान�NFC�r,r>�	normalize)r.�composed�texts   r4�	test_pr29zUnicodeFunctionsTest.test_pr29�s6��8���D����T�W�W�.�.�u�d�;�T�B�r6c�d�d}d}|j|jjd|�|�y)Nu?C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸Çu>C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸C̸Çr�r�)r.rn�bs   r4�test_issue10254z$UnicodeFunctionsTest.test_issue10254�s-��'��$��������*�*�5�!�4�a�8r6c�$�d}d}d}d}d}d}|j|jjd|�|�|j|jjd|�|�|j|jjd|�|�y)Nu	ᄀᅶᆨu	기ᆧu기ᆧu	기ᇃu기ᇃr�r�)r.�u1176_str_a�u1176_str_b�u11a7_str_a�u11a7_str_b�u11c3_str_a�u11c3_str_bs       r4�test_issue29456z$UnicodeFunctionsTest.test_issue29456�s���*��*��*��$��*��$��������*�*�5�+�>��L�������*�*�5�+�>��L�������*�*�5�+�>��Lr6c�H�|jj}|jt|d�|jt|t	��|jt|d�|jt|d�|j|d�d�|j|d�d�|j|d�d	�|j|d
�d�|j|d�d
�|j|d�d�|j|d�d	�y)N�ar�ra��Nru�Nau좔�Wuヲ�Hu?�Fu‐rXr])r>rOrarb�	bytearrayr,)r.�eaws  r4�test_east_asian_widthz*UnicodeFunctionsTest.test_east_asian_width�s����g�g�&�&�����)�S�$�/����)�S�)�+�6����)�S�"�-����)�S�$�/�����V��c�*�����V��d�+�����X���,�����X���,�����X���,�����X���,�����\�*�C�0r6c���|jj}dD]F}|j||�d�|j|jj	|d�d��HdD]F}|j||�d�|j|jj	|d�d��HdD]F}|j||�d�|j|jj	|d�d��Hy)Nu԰໏჆⃼꫊𐞽𑗲r�u﩮﫚𪛠𯨠𱍋𿿽r�u󰀀󿿮􀀀􏿰rX)r>rOr,�assertIsrP)r.r�r1s   r4� test_east_asian_width_unassignedz5UnicodeFunctionsTest.test_east_asian_width_unassigned�s����g�g�&�&��H�D����S��Y��,��M�M�$�'�'�,�,�t�T�2�D�9�I�
K�D����S��Y��,��M�M�$�'�'�,�,�t�T�2�D�9�K�
K�D����S��Y��,��M�M�$�'�'�,�,�t�T�2�D�9�Kr6c���|j|jjjd�d�|j|jjd�d�y)Nu⌚r�r�)r,r>�	ucd_3_2_0rOrds r4�!test_east_asian_width_9_0_changesz6UnicodeFunctionsTest.test_east_asian_width_9_0_changes�sF��������*�*�;�;�H�E�s�K�������1�1�(�;�S�Ar6N)r7r8r9r-rrQrUrerhrjrsrxr{r}r�r�r�r�r�r�r�r:r6r4r@r@Fs���B���u��8��8�.�u��D��D�
:�<�
<�=�B�B�=�>�
C�9�
M�1�:�"Br6r@c�b�eZdZed��Zd�Zd�Zd�Zd�Zd�Z	e
d�d��Zd	�Zd
�Z
y)�UnicodeMiscTestc�8�t|tj�y�N)rr=�UCDrds r4�test_disallow_instantiationz+UnicodeMiscTest.test_disallow_instantiation�s��	%�T�;�?�?�;r6c��d}tjd|�}d}|j||jj	d��y)NzGimport sys;sys.modules['unicodedata'] = None;eval("'\\N{SOFT HYPHEN}'")z-czUSyntaxError: (unicode error) \N escapes not supported (can't load unicodedata module)rD)r�assert_python_failure�assertIn�err�decode)r.�coder3�errors    r4�#test_failed_import_during_compilingz3UnicodeMiscTest.test_failed_import_during_compilingsA��/��
�4�4�T�4�@��.���
�
�e�V�Z�Z�.�.�w�7�8r6c�
�d}td�D]_}t|�}|jj|d�}|dk7s�0|j	||jj|��|dz
}�a|j
|dk\�y�Nr�rCr�
)rrr>rHr,rG�
assertTrue�r.�countr0�c�decs     r4�test_decimal_numeric_consistentz/UnicodeMiscTest.test_decimal_numeric_consistentss�����w��A��A��A��'�'�/�/�!�R�(�C��b�y�� � ��d�g�g�o�o�a�&8�9���
�� �	
������$r6c�
�d}td�D]_}t|�}|jj|d�}|dk7s�0|j	||jj|��|dz
}�a|j
|dk\�yr�)rrr>rFr,rGr�r�s     r4�test_digit_numeric_consistentz-UnicodeMiscTest.test_digit_numeric_consistent!ss�����w��A��A��A��'�'�-�-��2�&�C��b�y�� � ��d�g�g�o�o�a�&8�9���
�� �	
������$r6c�Z�|j|jjd�d�y)NzGOTHIC LETTER FAIHUu𐍆)r,r>rSrds r4�test_bug_1704793z UnicodeMiscTest.test_bug_1704793.s ����������(=�>��Mr6c�p�ddl}|j|jd��|j|jjd��|jdj	�dk(�|jdj	�dk(�|jdj	�dk(�y)Nru༺rnrX�ᵹuꝽ�.)r=r�rMr�r&)r.r=s  r4�test_ucd_510zUnicodeMiscTest.test_ucd_5101s�������,��,�,�X�6�7����K�1�1�:�:�8�D�D�E�	
����	�	��S�(�)�������(�(�2�3�����	�	��S�(�)r6rc
�b�|jdj�d�|jttjdz�D�cgc]S}dt|�j�t|�j
�zt|�j�zvr|��Uc}dg�ycc}w)Nr�r�r)r,r%rrrrr&r')r.r�s  r4�
test_bug_5828zUnicodeMiscTest.test_bug_5828<s���������)�8�4���� �����!1�2�
�2�a��S��V�\�\�^�C��F�L�L�N�:�3�q�6�<�<�>�I�I��2�
��C�	
��
s�
AB,c���|jdj�d�|jdj�d�|jdj�d�y)NuDŽuDžudž)r,r'rds r4�
test_bug_4971zUnicodeMiscTest.test_bug_4971HsG��������)�8�4�������)�8�4�������)�8�4r6c���td�D]a}t|�dzj�}|dvr |jt	|�dd|z��C|jt	|�dd|z��cy)Nr�rX)
r����
����i( i) �z\u%.4x should be a linebreakrz \u%.4x should not be a linebreak)rr�
splitlinesr,�len)r.r0�liness   r4�test_linebreak_7643z#UnicodeMiscTest.test_linebreak_7643Nss���w��A���V�c�\�-�-�/�E��7�7�� � ��U��Q�!@�1�!D�F�� � ��U��Q�!D�q�!H�J� r6N)r7r8r9rr�r�r�r�r�r�rr�r�r�r:r6r4r�r��sR���<��<�9� %�%�N�	*��u��	
��	
�5�	Jr6r�c�p�eZdZed��Zed��Zed�ed�d���Zd�Zd�Z	d�Z
y	)
�NormalizationTestc�F�|j�}tj|vSr�)�readliner=�unidata_version)�testfile�hdrs  r4�
check_versionzNormalizationTest.check_versionZs!�����!���*�*�c�1�1r6c��|jd�D�cgc]}t|d���}}dj|D�cgc]
}t|���c}�Scc}wcc}w)Nru�r)�split�intr)r)r2r`s  r4�unistrzNormalizationTest.unistr_sN��$(�J�J�s�O�4�O�q��A�r�
�O��4��w�w��-��1��A���-�.�.��5��-s
�A�A�networkrc�Z�d}dtj�d|��}	t|d|j��}5|j|�ddd�y#t$r|jd|�d��Y�=ttf$r!}|jd|�d	|���Yd}~�gd}~wwxYw#1swYyxYw)
NzNormalizationTest.txtz"http://www.pythontest.net/unicode/�/r)�encoding�checkz"Permission error when downloading z into the test data directoryzFailed to download z: )	r=r�rr��PermissionError�skipTest�OSErrorr�run_normalization_tests)r.�TESTDATAFILE�TESTDATAURL�testdata�excs     r4�test_normalizationz$NormalizationTest.test_normalizationds���/��:�;�;V�;V�:W�WX�Ye�Xf�g��	F�'��g�.2�.@�.@�B�H���(�(��2��X��
�	;��M�M�>�{�m�L9�:�
;���'�	F��M�M�/��}�B�s�e�D�E�E��	F���X�s(�A�B!�B�/B�=B�B�!B*c��d}i}d�}d�}d�}d�}|D�]�}d|vr|jd�d}|j�}|s�/|jd�r|j�d}�T|jd�dd	D�	cgc]}	|j|	���c}	\}
}}}
}|j	|||
�cxk(xr||�cxk(xr||�k(nc|�|j	|
||
�cxk(xr||�k(nc|�|j	|||
�cxk(xr||�cxk(xr||�k(nc|�|j	|||
�cxk(xr||�k(nc|�|j	|
||
�cxk(xr5||�cxk(xr'||�cxk(xr||
�cxk(xr||�k(nc|�|j	|||
�cxk(xr5||�cxk(xr'||�cxk(xr||
�cxk(xr||�k(nc|�|j	tjd
|��|j	tjd
|
��|j	tjd|��|j	tjd|��|j	tjd|
��|j	tjd
|��|dk(s���d||
<���ttjdz�D]Z}t|�}||vr�|j	|||�cxk(xr'||�cxk(xr||�cxk(xr||�k(nc|��\ycc}	w)Nc�.�tjd|�S)Nr��r=r��rLs r4r�z6NormalizationTest.run_normalization_tests.<locals>.NFC{����(�(���4�4r6c�.�tjd|�S)N�NFKCr�r�s r4r�z7NormalizationTest.run_normalization_tests.<locals>.NFKC~����(�(���5�5r6c�.�tjd|�S)N�NFDr�r�s r4r�z6NormalizationTest.run_normalization_tests.<locals>.NFD�r�r6c�.�tjd|�S)N�NFKDr�r�s r4r�z7NormalizationTest.run_normalization_tests.<locals>.NFKD�r�r6�#rz@Part�;rCr�r�r�r�z@Part1r)r��strip�
startswithr�r�r=�
is_normalizedrrrr)r.r��part�
part1_datar�r�r�r��liner`�c1�c2�c3�c4�c5r��Xs                 r4r�z)NormalizationTest.run_normalization_testsws������
�	5�	6�	5�	6��D��d�{��z�z�#��q�)���:�:�<�D������w�'��z�z�|�A����6:�j�j��o�c�r�6J�K�6J��d�k�k�!�n�6J�K�N�B�r�"�R��
�O�O�B�3�r�7�B�s�2�w�B�3�r�7�B�D�I��O�O�B�3�r�7�6�s�2�w�6��=��O�O�B�3�r�7�B�s�2�w�B�3�r�7�B�D�I��O�O�B�3�r�7�6�s�2�w�6��=��O�O�B�$�r�(�=�d�2�h�=� ��H�=�(,�R��=�48��H�=� �
"�
�O�O�B�$�r�(�=�d�2�h�=� ��H�=�(,�R��=�48��H�=� �
"�
�O�O�K�5�5�e�R�@�A��O�O�K�5�5�e�R�@�A��O�O�K�5�5�e�R�@�A��O�O�K�5�5�e�R�@�A��O�O�K�5�5�f�b�A�B��O�O�K�5�5�f�b�A�B��x��!"�
�2��E�J�s�~�~�a�'�(�A��A��A��J����O�O�A��Q��G�3�q�6�G�T�!�W�G��Q��G��K�	)��9Ls�=M=c���|jttj�|jttjdd�|jtjdd�d�y)N�unknownr_r�r)rarbr=r�rcr,rds r4�test_edge_casesz!NormalizationTest.test_edge_cases�sO�����)�[�%:�%:�;����*�k�&;�&;�Y��M�����.�.�v�r�:�B�?r6c�0�tjdd�y)Nr�u한글r�rds r4�test_bug_834676z!NormalizationTest.test_bug_834676�s�����e�^�4r6N)r7r8r9�staticmethodr�r�rr�r�rrr:r6r4r�r�Ys`���2��2��/��/��y�!��u��3��"�3�"9L�v@�
5r6r��__main__)�__doc__r�http.clientrrr=�unittest�test.supportrrrrr�TestCaser
r<r@r�r�r7�mainr:r6r4�<module>rs�����%�
���F�F�/8��*�*�/8�b�(�+�+��uB�.�uB�nZJ�)�ZJ�x`5��)�)�`5�F�z���H�M�M�O�r6

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