Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_unicodedata.cpython-39.opt-1.pyc

a

��g�>�@s�dZddlZddlmZddlZddlZddlZddlmZm	Z	m
Z
Gdd�dej�ZGdd�dej�Z
Gd	d
�d
e
�ZGdd�de
�ZGd
d�dej�Zedkr�e��dS)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_helperc@s eZdZdZed�dd��ZdS)�UnicodeMethodsTestZ(fbdf8106a3c7c242086b0a9efa03ad4d30d5b85d�cpucCsnt��}ttjd�D�]:}t|�}d|��d|��d|��d|�	�d|�
�d|��d|��d|�
�d|��d|d��d|d��d|d��d|d�	�d|d�
�d|d��d|d��d|d�
�d|d��|��|��|��|d��|d��|d��|d��g}|�d�|��dd	��q|��}|�||j�dS)
N�Z01�abcZ123z 	�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�result�r,�1/usr/local/lib/python3.9/test/test_unicodedata.py�test_method_checksums@












�#z'UnicodeMethodsTest.test_method_checksumN)�__name__�
__module__�__qualname__r%rr.r,r,r,r-rsrc@seZdZeZdS)�UnicodeDatabaseTestN)r/r0r1�unicodedata�dbr,r,r,r-r2Bsr2c@s�eZdZdZed�dd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS) �UnicodeFunctionsTestZ(d1e37a2854df60ac607b47b51189b9bf1b54bfdbrcCs�g}t��}ttjd�D]�}t|�}t|j�|d�d�t|j�	|d�d�t|j�
|d�d�|j�|�|j�|�|j�
|�t|j�|��t|j�|��g}|�d�|��d��q|��}|�||j�dS)Nr���z.12gr�ascii)rrrrrr�formatr4�digit�numeric�decimal�category�
bidirectional�
decomposition�str�mirrored�	combiningr r!r"r#r$r%)r&r*r'r(r)r+r,r,r-�test_function_checksumKs 


�z+UnicodeFunctionsTest.test_function_checksumcCs�|�|j�dd�d�|�|j�d�d�|�|j�dd�d�|�|j�d�d�|�|j�dd�d�|�|j�d�d�|�t|jj�|�t|jjd	�|�t|jjd
�dS�N�A�9�	�⅛�⑨�𠀀u𝟽��xx�x)r$r4r9�assertRaises�	TypeError�
ValueError�r&r,r,r-�
test_digitaszUnicodeFunctionsTest.test_digitcCs�|�|j�dd�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d	�|�|j�d
d�d�|�|j�d�d�|�t|jj�|�t|jjd
�|�t|jjd�dS)NrDrErFrGg�?rHg"@u꘧g@rI�𐄪i(#rKrL)r$r4r:rMrNrOrPr,r,r-�test_numericmsz!UnicodeFunctionsTest.test_numericcCs�|�|j�dd�d�|�|j�d�d�|�|j�dd�d�|�|j�dd�d�|�|j�dd�d�|�|j�d�d�|�t|jj�|�t|jjd	�|�t|jjd
�dSrC)r$r4r;rMrNrOrPr,r,r-�test_decimalzsz!UnicodeFunctionsTest.test_decimalcCs�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d	�d
�|�t|jj�|�t|jjd�dS)N�￾ZCn�aZLlrDZLurIZLorRZNorK)r$r4r<rMrNrPr,r,r-�
test_category�sz"UnicodeFunctionsTest.test_categorycCsv|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)	NrUr� ZWSrD�LrIrK)r$r4r=rMrNrPr,r,r-�test_bidirectional�sz'UnicodeFunctionsTest.test_bidirectionalcCsN|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)NrUr�¼z<fraction> 0031 2044 0034rK)r$r4r>rMrNrPr,r,r-�test_decomposition�sz'UnicodeFunctionsTest.test_decompositioncCsv|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)NrUrrVu∁rrIrK)r$r4r@rMrNrPr,r,r-�
test_mirrored�sz"UnicodeFunctionsTest.test_mirroredcCsv|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)NrUrrVu⃡��rIrK)r$r4rArMrNrPr,r,r-�test_combining�sz#UnicodeFunctionsTest.test_combiningcCs(d}|D]}|�|j�d|�|�qdS)N)uେ̀ାuᄀ̀ᅡuLi̍t-sṳ́u.मार्क ज़ुकेरबर्गu'किर्गिज़स्तान�NFC�r$r4�	normalize)r&Zcomposed�textr,r,r-�	test_pr29�szUnicodeFunctionsTest.test_pr29cCs"d}d}|�|j�d|�|�dS)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`ra)r&rV�br,r,r-�test_issue10254�sz$UnicodeFunctionsTest.test_issue10254cCs^d}d}d}d}d}d}|�|j�d|�|�|�|j�d|�|�|�|j�d|�|�dS)Nu	ᄀᅶᆨu	기ᆧu기ᆧu	기ᇃu기ᇃr`ra)r&Zu1176_str_aZu1176_str_bZu11a7_str_aZu11a7_str_bZu11c3_str_aZu11c3_str_br,r,r-�test_issue29456�sz$UnicodeFunctionsTest.test_issue29456cCs�|jj}|�t|d�|�t|t��|�t|d�|�t|d�|�|d�d�|�|d�d�|�|d�d	�|�|d
�d�|�|d�d
�|�|d�d�|�|d�d	�dS)N�arZra��NrXZNau좔�Wuヲ�Hu?�Fu‐rDrI)r4�east_asian_widthrMrN�	bytearrayr$)r&Zeawr,r,r-�test_east_asian_width�sz*UnicodeFunctionsTest.test_east_asian_widthcCs.|�|jj�d�d�|�|j�d�d�dS)Nu⌚rjrk)r$r4�	ucd_3_2_0rnrPr,r,r-�!test_east_asian_width_9_0_changes�sz6UnicodeFunctionsTest.test_east_asian_width_9_0_changesN)r/r0r1r%rrBrQrSrTrWrZr\r]r_rdrfrgrprrr,r,r,r-r5Es 


			r5c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�UnicodeMiscTestcCs,d}t�d|�}d}|�||j�d��dS)NzGimport sys;sys.modules['unicodedata'] = None;eval("'\\N{SOFT HYPHEN}'")z-czUSyntaxError: (unicode error) \N escapes not supported (can't load unicodedata module)r7)rZassert_python_failureZassertIn�err�decode)r&�coder+�errorr,r,r-�#test_failed_import_during_compiling�sz3UnicodeMiscTest.test_failed_import_during_compilingcCs^d}td�D]>}t|�}|j�|d�}|dkr|�||j�|��|d7}q|�|dk�dS�Nr�r6r�
)rrr4r;r$r:�
assertTrue�r&�countr(�cZdecr,r,r-�test_decimal_numeric_consistent�s
z/UnicodeMiscTest.test_decimal_numeric_consistentcCs^d}td�D]>}t|�}|j�|d�}|dkr|�||j�|��|d7}q|�|dk�dSry)rrr4r9r$r:r|r}r,r,r-�test_digit_numeric_consistents
z-UnicodeMiscTest.test_digit_numeric_consistentcCs|�|j�d�d�dS)NzGOTHIC LETTER FAIHUu𐍆)r$r4�lookuprPr,r,r-�test_bug_1704793sz UnicodeMiscTest.test_bug_1704793cCsfddl}|�|�d��|�|j�d��|�d��dk�|�d��dk�|�d��dk�dS)Nru༺rVrD�ᵹuꝽ�.)r3r|r@rqr)r&r3r,r,r-�test_ucd_510szUnicodeMiscTest.test_ucd_510cCs6|�d��d�|�dd�ttjd�D�dg�dS)Nr�cSs8g|]0}dt|���t|���t|���vr|�qS)�)rrrr)�.0rr,r,r-�
<listcomp> s(�z1UnicodeMiscTest.test_bug_5828.<locals>.<listcomp>rr)r$rrrrrPr,r,r-�
test_bug_5828s��zUnicodeMiscTest.test_bug_5828cCs4|�d��d�|�d��d�|�d��d�dS)NuDŽuDžudž)r$rrPr,r,r-�
test_bug_4971'szUnicodeMiscTest.test_bug_4971cCsXtd�D]J}t|�d��}|dvr<|�t|�dd|�q|�t|�dd|�qdS)NrzrD)
r{���
����i( i) �z\u%.4x should be a linebreakrz \u%.4x should not be a linebreak)rr�
splitlinesr$�len)r&r(�linesr,r,r-�test_linebreak_7643-s��z#UnicodeMiscTest.test_linebreak_7643N)r/r0r1rxr�r�r�r�r�r�r�r,r,r,r-rs�s

rsc@sLeZdZedd��Zedd��Zed�dd��Zdd	�Zd
d�Z	dd
�Z
dS)�NormalizationTestcCs|��}tj|vS)N)�readliner3�unidata_version)ZtestfileZhdrr,r,r-�
check_version9szNormalizationTest.check_versioncCs(dd�|�d�D�}d�dd�|D��S)NcSsg|]}t|d��qS)�)�int�r�rLr,r,r-r�@�z,NormalizationTest.unistr.<locals>.<listcomp>rXrcSsg|]}t|��qSr,)rr�r,r,r-r�Ar�)�splitr!)r*r,r,r-�unistr>szNormalizationTest.unistr�networkc	Cs�d}dtj�d|��}zt|d|jd�}WnHtyN|�d|�d��Yn&ttfyr|�d|���Yn0|�|�	|�Wd�n1s�0YdS)	NzNormalizationTest.txtz"http://www.pythontest.net/unicode/�/r)�encoding�checkz"Permission error when downloading z into the test data directoryzCould not retrieve )
r3r�rr��PermissionErrorZskipTest�OSErrorrZfail�run_normalization_tests)r&ZTESTDATAFILEZTESTDATAURL�testdatar,r,r-�test_normalizationCs�
z$NormalizationTest.test_normalizationcsd}i}dd�}dd�}dd�}dd�}|D�]\}d	|vrH|�d	�d
}|��}|sVq,|�d�rn|��d
}q,�fdd
�|�d�dd�D�\}	}
}}}
��|
||	�ko�||
�ko�||�kn|���|||�ko�||
�kn|���|||	�k�o&||
�k�o&||�kn|���|
||�k�oP||
�kn|���|||	�k�o�||
�k�o�||�k�o�||�k�o�||
�kn|���|
||	�k�o||
�k�o||�k�o||�k�o||
�kn|���t�d|
����t�d|����t�d|����t�d|
����t�d|����t�d|
��|dkr,d||	<q,ttjd�D]f}t	|�}||v�r��q���|||�k�o�||�k�o�||�k�o�||�kn|��q�dS)NcSst�d|�S)Nr`�r3rb�r?r,r,r-r`Ysz6NormalizationTest.run_normalization_tests.<locals>.NFCcSst�d|�S)N�NFKCr�r�r,r,r-r�\sz7NormalizationTest.run_normalization_tests.<locals>.NFKCcSst�d|�S)N�NFDr�r�r,r,r-r�_sz6NormalizationTest.run_normalization_tests.<locals>.NFDcSst�d|�S)N�NFKDr�r�r,r,r-r�bsz7NormalizationTest.run_normalization_tests.<locals>.NFKD�#rz@Partcsg|]}��|��qSr,)r�r�rPr,r-r�nr�z=NormalizationTest.run_normalization_tests.<locals>.<listcomp>�;r6r`r�r�r�z@Part1r)
r��strip�
startswithr|r3�
is_normalizedrrrr)r&r��partZ
part1_datar`r�r�r��line�c1�c2Zc3Zc4Zc5r�Xr,rPr-r�Usf

*6(:*&�
�
��&�
�
��

z)NormalizationTest.run_normalization_testscCs8|�ttj�|�ttjdd�|�t�dd�d�dS)N�unknownrKr�r)rMrNr3rbrOr$rPr,r,r-�test_edge_cases�sz!NormalizationTest.test_edge_casescCst�dd�dS)Nr`u한글r�rPr,r,r-�test_bug_834676�sz!NormalizationTest.test_bug_834676N)r/r0r1�staticmethodr�r�rr�r�r�r�r,r,r,r-r�8s


;r��__main__)�__doc__rZhttp.clientrrr3ZunittestZtest.supportrrrZTestCaserr2r5rsr�r/�mainr,r,r,r-�<module>s1Vb

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