Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_unicode_file.cpython-311.pyc
�

�Ke���@�ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZej
js:	e
jej����n#eef$rejd���wxYwd�ZGd�dej��Zedkrej��dSdS)�N)�rmtree�
change_cwd�TESTFN_UNICODE�TESTFN_UNENCODABLE�create_empty_filez1No Unicode filesystem semantics on this platform.c�p�tj�|��rtj|��dSdS�N)�os�path�exists�unlink)�filenames �@/usr/local/apps/python3/lib/python3.11/test/test_unicode_file.py�remove_if_existsrs8��	�w�~�~�h����
�	�(��������c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestUnicodeFilesc
��|�tj�|����|�tj�|����|�tj|tj����|�tj�tj�|������|�tj�tj�|������|�tjtj�|��tj����tj|d��tj	|d��tj	|tj
��tj
��f��|�||��|�tj�|��tj�tjtj
|����d��k��tj�tj�|����\}}tj|��}t!jd|��}d�|D��}|�||��dS)Ni�r�NFDc�8�g|]}tjd|����S)r)�unicodedata�	normalize)�.0�fs  r�
<listcomp>z/TestUnicodeFiles._do_single.<locals>.<listcomp>4s%��H�H�H��[�*�5�!�4�4�H�H�Hr)�
assertTruer
rr�isfile�access�R_OK�abspath�chmod�utime�time�_do_copyish�glob�escape�split�listdirrr�assertIn)�selfrr�base�	file_lists     r�
_do_singlezTestUnicodeFiles._do_singles���������x�0�0�1�1�1��������x�0�0�1�1�1�����	�(�B�G�4�4�5�5�5��������r�w���x�'@�'@�A�A�B�B�B��������r�w���x�'@�'@�A�A�B�B�B�����	�"�'�/�/�(�";�";�R�W�E�E�F�F�F�
���5�!�!�!�
���4� � � �
���D�I�K�K�����5�6�6�6�����8�,�,�,�����G�O�O�H�%�%�r�w���t�y���X�AV�AV�7W�7W�XY�7Z�'[�'[�[�	]�	]�	]��W�]�]�2�7�?�?�8�#<�#<�=�=�
��d��J�t�$�$�	��$�U�D�1�1��H�H�i�H�H�H�	��
�
�d�I�&�&�&�&�&rc���|�tj�|����tj||dz��|�tj�|����|�tj�|dz����tj|dz|��|�tj�|dz����|�tj�|����t
j||dz��tj|dz��t
j	||dz��|�tj�
|����|�tj�
|dz����t
j	|dz|��|�tj�
|dz����|�tj�
|����t
j||dz��|�tj�|dz����tj|dz��|�tj�
|dz����dS)Nz.new)rr
rr�rename�assertFalse�shutil�copyr
�mover�copy2)r*�	filename1�	filename2s   rr$zTestUnicodeFiles._do_copyish9sF���������y�1�1�2�2�2�
�	�)�Y��/�0�0�0��������	�2�2�3�3�3��������y�6�'9�:�:�;�;�;�
�	�)�f�$�i�0�0�0��������	�F�(:�;�;�<�<�<��������y�1�1�2�2�2���I�y�6�1�2�2�2�
�	�)�f�$�%�%�%���I�y�6�1�2�2�2��������	�2�2�3�3�3��������y�6�'9�:�:�;�;�;���I��&�	�2�2�2��������	�F�(:�;�;�<�<�<��������y�1�1�2�2�2�	��Y�	�F� 2�3�3�3��������y�6�'9�:�:�;�;�;�
�	�)�f�$�%�%�%��������	�F�(:�;�;�<�<�<�<�<rc��tj�|��rt|��tj|��	t|��5tj��}|}tjd|��}tjd|��}|�	tj�
|��|��ddd��n#1swxYwYtj|��dS#tj|��wxYw)Nr)r
r�isdirr�mkdirr�getcwdrr�assertEqual�basename�rmdir)r*�	make_name�
chdir_name�
cwd_result�name_results     r�
_do_directoryzTestUnicodeFiles._do_directoryVs7��
�7�=�=��#�#�	��9����
������
	 ��J�'�'�
K�
K��Y�[�[�
�'��(�2�5�*�E�E�
�)�3�E�;�G�G��� � ���!1�!1�*�!=�!=�k�J�J�J�
K�
K�
K�
K�
K�
K�
K�
K�
K�
K�
K����
K�
K�
K�
K�
�H�Y�������B�H�Y�������s1�C3�A3C�C3�C�C3�C�C3�3D	c�6�t|��t|��	|�|��tj|��n#tj|��wxYw|�tj�|����tj|tj	tj
z��}tj|��	|�|��tj|��dS#tj|��wxYwr	)rrr-r
r
rrr�open�O_CREAT�O_WRONLY�close)r*rrs   r�_test_singlezTestUnicodeFiles._test_singlehs�����"�"�"��(�#�#�#�	 ��O�O�H�%�%�%��I�h������B�I�h�����������B�G�N�N�8�4�4�4�5�5�5��G�H�b�j�2�;�6�7�7��
������	 ��O�O�H�%�%�%��I�h�������B�I�h�������s�A
�
A �D�Dc��|�t��t�|�t��dSdSr	)rHrr)r*s r�test_single_filesz"TestUnicodeFiles.test_single_fileszs?�����.�)�)�)��)����0�1�1�1�1�1�*�)rc��d}|�t|zt|z��t�(|�t|zt|z��dSdS)Nz.dir)rBrr)r*�exts  r�test_directoriesz!TestUnicodeFiles.test_directoriessi�������>�#�-�~�c�/A�B�B�B��)����1�#�5�1�#�5�
7�
7�
7�
7�
7�*�)rN)	�__name__�
__module__�__qualname__r-r$rBrHrJrM�rrrrsn������'�'�'�4=�=�=�: � � �$ � � �$2�2�2�
	7�	7�	7�	7�	7rr�__main__)r
r%r#r1�sysr�unittest�test.support.os_helperrrrrrr�supports_unicode_filenames�encode�getfilesystemencoding�UnicodeError�	TypeError�SkipTestr�TestCaserrN�mainrQrr�<module>r^sx������������������
�
�
�
���������+�+�+�+�+�+�+�+�+�+�+�+�+�+�
�w�)�U�U����7�c�7�9�9�:�:�:�:���)�$�U�U�U� �h�� S�T�T�T�U����
���o7�o7�o7�o7�o7�x�(�o7�o7�o7�d�z����H�M�O�O�O�O�O��s�A�A.