Your IP : 216.73.216.213


Current Path : /opt/alt/python311/lib64/python3.11/test/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/test/__pycache__/test_unicode_file_functions.cpython-311.pyc

�

�0�i����ddlZddlZddlZddlZddlmZddlmZddlm	Z	gd�Z
ejdkre
�gd���ej
jsDej��Z	e
D]Ze�e���n#e$rejd���wxYwGd	�d
ej��ZGd�de��ZGd
�de��ZGd�de��ZGd�de��Zedkrej��dSdS)�N��	normalize)�	os_helper)�support)
�1_abc�2_asciiu
3_Grüß-Gottu4_Γειά-σαςu5_Здравствуйтеu6_にぽんu7_השקצץסu8_曨曩曫u9_曨שんдΓßu	10_΅´�darwin)	u	11_΅ϓϔu12_΅ϓϔu13_ ̈́ΎΫu14_ẛ῁῍῎῏῝῞῟῭u15_΅´𣏕u
16_   Au
17_   Au
18_   Az19_   Az>only NT+ and systems with Unicode-friendly filesystem encodingc�N�eZdZee��ZdZd�Zd�Ze	dfd�Z
d�Zej
dkree	fZneZd�Zejej
d	kd
��ejejpejd��d�����Zejej
d	kd
��d
���Zd�Zd�ZdS)�UnicodeFileTestsNc�j�	tjtj��n#t$rYnwxYw|�tjtj��t��}|jD]�}tj	�
tj|�|����}t|d��5}|�
|dz�d����ddd��n#1swxYwYtj|��|�|����||_dS�N�wb�
�utf-8)�os�mkdirr�TESTFN�FileExistsError�
addCleanup�rmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr�name�fs    �G/opt/alt/python311/lib64/python3.11/test/test_unicode_file_functions.py�setUpzUnicodeFileTests.setUpAsB��	��H�Y�%�&�&�&�&���	�	�	��D�	�������	�(�)�*:�;�;�;������J�	�	�D��7�<�<�	� 0�$�)�)�D�/�/�B�B�D��d�D�!�!�
5�Q�����d��*�*�7�3�3�4�4�4�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5����
5�
5�
5�
5��G�D�M�M�M��I�I�d�O�O�O�O���
�
�
s�!�
.�.�?,C7�7C;	�>C;	c�>�|jrt|j|��S|S�N)�normal_formr)r!�ss  r$rzUnicodeFileTests.normQs%����	2��T�-�q�1�1�1���Tc
���|�|��5}||��ddd��n#1swxYwY|jj}|r'|�||d|j�d|�d|����dSdS)Nz
Function '�(z-) failed with bad filename in the exception: )�assertRaises�	exception�filename�assertEqual�__name__)r!�fnr/�expected_exception�check_filename�c�exc_filenames       r$�_apply_failurezUnicodeFileTests._apply_failureVs����
�
�1�
2�
2�	�a��B�x�L�L�L�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��{�+���	D����\�8�8� �k�k�k�8�8�8�\�\�6C�
D�
D�
D�
D�
D�	D�	Ds�.�2�2c��|jD]�}d|z}|�t|��|�tj|��|�tj|��|�tj|��|�tj|��|�tj|����dS)N�not_)	rr7rrr�chdir�rmdir�remove�listdir�r!r"s  r$�
test_failureszUnicodeFileTests.test_failuresas����J�	2�	2�D��D�=�D�����d�+�+�+�������.�.�.������$�/�/�/������$�/�/�/�����	�4�0�0�0�����
�D�1�1�1�1�	2�	2r*�win32c�,�|jD]�}t|d��}|�|dz�d����|���tj|��|�t
j||j	����dSr
)
rrrr�closerrr7r=�_listdir_failure)r!r"r#s   r$�	test_openzUnicodeFileTests.test_openrs����J�	I�	I�D��T�4� � �A�
�G�G�T�$�Y�&�&�w�/�/�0�0�0�
�G�G�I�I�I��G�D�M�M�M�����
�D�$�2G�H�H�H�H�	I�	Ir*r	zirrelevant test on Mac OS Xz:test fails on Emscripten/WASI when host platform is macOS.c�:��t|j��}t��}tgd���D] �|t�fd�|D����z}�!||z}|D]�}|�t|��|�tj|��|�tj|��|�tj|��|�tj|��|�tj	|����dS)N)�NFC�NFD�NFKC�NFKDc3�8�K�|]}t�|��V��dSr'r)�.0�file�nfs  �r$�	<genexpr>z2UnicodeFileTests.test_normalize.<locals>.<genexpr>�s-�����@�@�$�)�B��-�-�@�@�@�@�@�@r*)
rrr7rrrr:r;r<r=)r!r�othersr"rMs    @r$�test_normalizezUnicodeFileTests.test_normalize~s����D�J���������4�4�4�5�5�	A�	A�B��c�@�@�@�@�%�@�@�@�@�@�@�F�F��%����	2�	2�D�����d�+�+�+�������.�.�.������$�/�/�/������$�/�/�/�����	�4�0�0�0�����
�D�1�1�1�1�
	2�	2r*c�B�t|j��}tj��5tjdt
��t
jtj	�
tj������}ddd��n#1swxYwYt
jtj	��}td�|D����}|�
|||�d|����|�
t|��t|����dS)N�ignorec3�jK�|].}tj�tj|��V��/dSr')rrrrr)rKr#s  r$rNz0UnicodeFileTests.test_listdir.<locals>.<genexpr>�s5����@�@��"�'�,�,�y�/��3�3�@�@�@�@�@�@r*z != )rr�warnings�catch_warnings�simplefilter�DeprecationWarningrr=rrr�sys�getfilesystemencodingr0�len)r!�sf0�f1�f2�sf2s     r$�test_listdirzUnicodeFileTests.test_listdir�s4���$�*�o�o��
�
$�
&�
&�	:�	:��!�(�,>�?�?�?���I�,�3�3��5�7�7�9�9�:�:�B�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:��Z�	�(�
)�
)���@�@�R�@�@�@�@�@������c����c�c�#:�;�;�;�����R���#�b�'�'�*�*�*�*�*s�AB�B�Bc�n�|jD],}tj|d��tjd|���-dS)N�tmp)rr�renamer>s  r$�test_renamezUnicodeFileTests.test_rename�sD���J�	#�	#�D��I�d�E�"�"�"��I�e�T�"�"�"�"�	#�	#r*c���tj�tjd��}d}tj|��5t
|d��5}|�|dz�d����ddd��n#1swxYwYtj	|tj
��tj|��ddd��dS#1swxYwYdS)NuGrüß-曨曩曫uß-曨曩曫rrr)rrrrr�temp_cwdrrr�access�R_OKr<)r!�dirnamer/r#s    r$�test_directoryzUnicodeFileTests.test_directory�sE���'�,�,�y�/�>�@�@��,��
�
��
(�
(�	 �	 ��h��%�%�
;������D��0�0��9�9�:�:�:�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;����
;�
;�
;�
;��I�h�r�w�'�'�'��I�h����		 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 ����	 �	 �	 �	 �	 �	 s6�C�,B
�>C�
B	�C�B	�6C�C�C)r1�
__module__�__qualname__r�	filenamesrr(r%r�FileNotFoundErrorr7r?rX�platform�NotADirectoryErrorrCrD�unittest�skipIfr�
is_emscripten�is_wasirPr_rcri�r*r$rr=sX�������C�	�N�N�E��K���� ���+<�&*�	D�	D�	D�	D�	2�	2�	2��|�w���-�/@�@���-��I�I�I��X�_�S�\�X�-�/L�M�M��X�_���0���D���2�2�	��N�M�
2�"�X�_�S�\�X�-�/L�M�M�	+�	+�N�M�	+�#�#�#�
 � � � � r*rc��eZdZdZdS)�UnicodeNFCFileTestsrFN�r1rjrkr(rtr*r$rvrv���������K�K�Kr*rvc��eZdZdZdS)�UnicodeNFDFileTestsrGNrwrtr*r$rzrz�rxr*rzc��eZdZdZdS)�UnicodeNFKCFileTestsrHNrwrtr*r$r|r|���������K�K�Kr*r|c��eZdZdZdS)�UnicodeNFKDFileTestsrINrwrtr*r$rr�r}r*r�__main__)rrXrprT�unicodedatar�test.supportr�testrrlrn�extendr�supports_unicode_filenamesrY�
fsencodingr"r�UnicodeEncodeError�SkipTest�TestCaserrvrzr|rr1�mainrtr*r$�<module>r�s>��
�	�	�	�
�
�
�
���������!�!�!�!�!�!�"�"�"�"�"�"�������
�
�
�	�(�<�8���
���������$
�w�)�H�*��*�,�,�J�H��	$�	$�D��K�K�
�#�#�#�#�	$���H�H�H��h��!G�H�H�	H�H����
p �p �p �p �p �x�(�p �p �p �f�����*���������*���������+���������+�����z����H�M�O�O�O�O�O��s�%B�B