Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_unicodedata.cpython-310.pyc
o

�9jG�@s�dZddlZddlmZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
Gdd�dej�ZGdd�dej�ZGd	d
�d
e�ZGdd�de�ZGd
d�dej�Zedkr]e��dSdS)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_instantiation�ResourceDeniedc@s eZdZdZed�dd��ZdS)�UnicodeMethodsTest�(fbdf8106a3c7c242086b0a9efa03ad4d30d5b85d�cpucCslt��}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��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�result�r2�,/usr/lib/python3.10/test/test_unicodedata.py�test_method_checksums@












�#z'UnicodeMethodsTest.test_method_checksumN)�__name__�
__module__�__qualname__r+rr4r2r2r2r3r	sr	c@seZdZeZdS)�UnicodeDatabaseTestN)r5r6r7�unicodedata�dbr2r2r2r3r8Dsr8c@s�eZdZdZed�dd��Zed�dd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)&�UnicodeFunctionsTest�(d1e37a2854df60ac607b47b51189b9bf1b54bfdbrcCs�g}t��}ttjd�D]K}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�formatr:�digit�numeric�decimal�category�
bidirectional�
decomposition�str�mirrored�	combiningr&r'r(r)r*r+)r,r0r-r.r/r1r2r2r3�test_function_checksumMs 


�z+UnicodeFunctionsTest.test_function_checksumcCsFttjd�D]}t|�}|j�|d�}r |�|j�|�|�qdS)Nr)rrrrr:�namer*�lookup)r,r.r/�looked_namer2r2r3�test_name_inverse_lookupcs��z-UnicodeFunctionsTest.test_name_inverse_lookupcCs�|�|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*r:r@�assertRaises�	TypeError�
ValueError�r,r2r2r3�
test_digitjszUnicodeFunctionsTest.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)NrOrPrQrRg�?rSg"@u꘧g@rT�𐄪i(#rVrW)r*r:rArXrYrZr[r2r2r3�test_numericvsz!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
�dSrN)r*r:rBrXrYrZr[r2r2r3�test_decimal�sz!UnicodeFunctionsTest.test_decimalcCs�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d	�d
�|�t|jj�|�t|jjd�dS)N�￾�Cn�a�LlrO�LurT�Lor]�NorV)r*r:rCrXrYr[r2r2r3�
test_category�sz"UnicodeFunctionsTest.test_categorycCsv|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)	Nr`r� �WSrO�LrTrV)r*r:rDrXrYr[r2r2r3�test_bidirectional��z'UnicodeFunctionsTest.test_bidirectionalcCsN|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)Nr`r�¼z<fraction> 0031 2044 0034rV)r*r:rErXrYr[r2r2r3�test_decomposition�sz'UnicodeFunctionsTest.test_decompositioncC�v|�|j�d�d�|�|j�d�d�|�|j�d�d�|�|j�d�d�|�t|jj�|�t|jjd�dS)Nr`rrbu∁rrTrV)r*r:rGrXrYr[r2r2r3�
test_mirrored�rlz"UnicodeFunctionsTest.test_mirroredcCro)Nr`rrbu⃡��rTrV)r*r:rHrXrYr[r2r2r3�test_combining�rlz#UnicodeFunctionsTest.test_combiningcCs(d}|D]
}|�|j�d|�|�qdS)N)uେ̀ାuᄀ̀ᅡuLi̍t-sṳ́u.मार्क ज़ुकेरबर्गu'किर्गिज़स्तान�NFC�r*r:�	normalize)r,�composed�textr2r2r3�	test_pr29�s�zUnicodeFunctionsTest.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̸Çrsrt)r,rb�br2r2r3�test_issue10254�sz$UnicodeFunctionsTest.test_issue10254cCshd}d}d}|�|j�d|�|�|�|j�d|�|�|�|j�d|�|�|�|j�d|�|�dS)Nu�à̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀u�à̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀u�à̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀�NFD�NFKDrs�NFKCrt)r,�payload�nfd�nfcr2r2r3�test_long_combining_mark_run�sz1UnicodeFunctionsTest.test_long_combining_mark_runcCs�d}d}d}d}d}|�|j�d|�|�|�|j�d|�|�|�|j�d|�|�|�|j�d	|�|�|�|j�d|�|�|�|j�d|�|�|�|j�d|�|�|�|j�d	|�|�dS)
Nu'à̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀u'à̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀u&à̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀uyà̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀uxà̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀r{r|rsr}rt)r,�
short_payload�	short_nfd�	short_nfc�long_sorted�long_sorted_nfcr2r2r3�"test_combining_mark_run_fast_paths�sz7UnicodeFunctionsTest.test_combining_mark_run_fast_pathscCs^d}d}d}d}d}d}|�|j�d|�|�|�|j�d|�|�|�|j�d|�|�dS)Nu	ᄀᅶᆨu	기ᆧu기ᆧu	기ᇃu기ᇃrsrt)r,�u1176_str_a�u1176_str_b�u11a7_str_a�u11a7_str_b�u11c3_str_a�u11c3_str_br2r2r3�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�ar�ra��Nrh�Nau좔�Wuヲ�Hu?�Fu‐rOrT)r:�east_asian_widthrXrY�	bytearrayr*)r,�eawr2r2r3�test_east_asian_width�sz*UnicodeFunctionsTest.test_east_asian_widthcCs.|�|jj�d�d�|�|j�d�d�dS)Nu⌚r�r�)r*r:�	ucd_3_2_0r�r[r2r2r3�!test_east_asian_width_9_0_changessz6UnicodeFunctionsTest.test_east_asian_width_9_0_changesN)r5r6r7r+rrIrMr\r^r_rgrkrnrprrrxrzr�r�r�r�r�r2r2r2r3r;Gs*



			r;c@sXeZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�UnicodeMiscTestcCst|tj�dS�N)rr9�UCDr[r2r2r3�test_disallow_instantiation	sz+UnicodeMiscTest.test_disallow_instantiationcCs,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)r>)r�assert_python_failure�assertIn�err�decode)r,�coder1�errorr2r2r3�#test_failed_import_during_compilingsz3UnicodeMiscTest.test_failed_import_during_compilingcC�^d}td�D]}t|�}|j�|d�}|dkr%|�||j�|��|d7}q|�|dk�dS�Nr�r=r�
)rrr:rBr*rA�
assertTrue�r,�countr.�c�decr2r2r3�test_decimal_numeric_consistent��z/UnicodeMiscTest.test_decimal_numeric_consistentcCr�r�)rrr:r@r*rAr�r�r2r2r3�test_digit_numeric_consistent+r�z-UnicodeMiscTest.test_digit_numeric_consistentcCs|�|j�d�d�dS)NzGOTHIC LETTER FAIHUu𐍆)r*r:rKr[r2r2r3�test_bug_17047938sz UnicodeMiscTest.test_bug_1704793cCsfddl}|�|�d��|�|j�d��|�d��dk�|�d��dk�|�d��dk�dS)Nru༺rbrO�ᵹuꝽ�.)r9r�rGr�r$)r,r9r2r2r3�test_ucd_510;szUnicodeMiscTest.test_ucd_510cCs6|�d��d�|�dd�ttjd�D�dg�dS)Nr�cSs8g|]}dt|���t|���t|���vr|�qS)�)rr#r$r%)�.0r�r2r2r3�
<listcomp>Js
(�z1UnicodeMiscTest.test_bug_5828.<locals>.<listcomp>rr)r*r#rrrr[r2r2r3�
test_bug_5828Fs��zUnicodeMiscTest.test_bug_5828cCs4|�d��d�|�d��d�|�d��d�dS)NuDŽuDžudž)r*r%r[r2r2r3�
test_bug_4971QszUnicodeMiscTest.test_bug_4971cCsXtd�D]%}t|�d��}|dvr|�t|�dd|�q|�t|�dd|�qdS)Nr�rO)
r����
����i( i) �z\u%.4x should be a linebreakrz \u%.4x should not be a linebreak)rr�
splitlinesr*�len)r,r.�linesr2r2r3�test_linebreak_7643Ws���z#UnicodeMiscTest.test_linebreak_7643N)
r5r6r7rr�r�r�r�r�r�r�r�r�r2r2r2r3r�s


r�c@sLeZdZedd��Zedd��Zed�dd��Zdd	�Zd
d�Z	dd
�Z
dS)�NormalizationTestcCs|��}tj|vSr�)�readliner9�unidata_version)�testfile�hdrr2r2r3�
check_versioncs
zNormalizationTest.check_versioncCs(dd�|�d�D�}d�dd�|D��S)NcSsg|]}t|d��qS)�)�int�r�rWr2r2r3r�j�z,NormalizationTest.unistr.<locals>.<listcomp>rhrcSsg|]}t|��qSr2)rr�r2r2r3r�ks)�splitr')r0r2r2r3�unistrhszNormalizationTest.unistr�networkc
Cs�d}dtj�d|��}z
t|d|jd�}Wn0ty'|�d|�d��YnttfyE}z|�d|�d	|���WYd}~nd}~ww|�|�|�Wd�dS1sYwYdS)
NzNormalizationTest.txtz"http://www.pythontest.net/unicode/�/r)�encoding�checkz"Permission error when downloading z into the test data directoryzFailed to download z: )	r9r�rr��PermissionError�skipTest�OSErrorr�run_normalization_tests)r,�TESTDATAFILE�TESTDATAURL�testdata�excr2r2r3�test_normalizationms
�"��"�z$NormalizationTest.test_normalizationcs�d}i}dd�}dd�}dd�}dd�}|D�]$}d	|vr$|�d	�d
}|��}|s+q|�d�r7|��d
}q�fdd
�|�d�dd�D�\}	}
}}}
��|
||	�kob||
�kob||�kn|���|||�kov||
�kn|���|||	�ko�||
�ko�||�kn|���|
||�ko�||
�kn|���|||	�ko�||
�ko�||�ko�||�ko�||
�kn|���|
||	�ko�||
�ko�||�ko�||�ko�||
�kn|���t�d|
����t�d|����t�d|����t�d|
����t�d|����t�d|
��|dk�r;d||	<qttjd�D]3}t	|�}||v�rP�qC��|||�k�op||�k�op||�k�op||�kn|��qCdS)NcS�t�d|�S)Nrs�r9ru�rFr2r2r3rs��z6NormalizationTest.run_normalization_tests.<locals>.NFCcSr�)Nr}r�r�r2r2r3r}�r�z7NormalizationTest.run_normalization_tests.<locals>.NFKCcSr�)Nr{r�r�r2r2r3r{�r�z6NormalizationTest.run_normalization_tests.<locals>.NFDcSr�)Nr|r�r�r2r2r3r|�r�z7NormalizationTest.run_normalization_tests.<locals>.NFKD�#rz@Partcsg|]}��|��qSr2)r�r�r[r2r3r��r�z=NormalizationTest.run_normalization_tests.<locals>.<listcomp>�;r=rsr{r}r|z@Part1r)
r��strip�
startswithr�r9�
is_normalizedrrrr)r,r��part�
part1_datarsr}r{r|�line�c1�c2�c3�c4�c5r��Xr2r[r3r�sj

*6(6("����"����
�
N�z)NormalizationTest.run_normalization_testscCs8|�ttj�|�ttjdd�|�t�dd�d�dS)N�unknownrVr}r)rXrYr9rurZr*r[r2r2r3�test_edge_cases�sz!NormalizationTest.test_edge_casescCst�dd�dS)Nrsu한글r�r[r2r2r3�test_bug_834676�sz!NormalizationTest.test_bug_834676N)r5r6r7�staticmethodr�r�rr�r�r�r�r2r2r2r3r�bs


;r��__main__)�__doc__r�http.clientrrr9�unittest�test.supportrrrrrr�TestCaser	r8r;r�r�r5�mainr2r2r2r3�<module>s  1A[b�

Youez - 2016 - github.com/yon3zu
LinuXploit