Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/__pycache__/test_unicode_file_functions.cpython-312.opt-2.pyc

�

'Μg����ddlZddlZddlZddlZddlmZddlmZddlm	Z	gd�Z
ejdk7re
jgd��ejjs+ej�Z	e
D]Zej%e��	Gd	�d
ej*�ZGd�de�ZGd
�de�ZGd�de�ZGd�de�Zedk(rej8�yy#e$rej(d��wxYw)�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�p�eZdZee�ZdZd�Zd�Ze	dfd�Z
d�Zejdk(ree	fZneZd�Zej$ejd	k(d
�ej$ej(xsej*d�d���Zej$ejd	k(d
�d
��Zd�Zd�Zy)�UnicodeFileTestsNc�X�	tjtj�|jtjtj�t�}|jD]�}tjjtj|j|��}t|d�5}|j|dzjd��ddd�tj|�|j!|���||_y#t$rY��wxYw#1swY�HxYw�N�wb�
�utf-8)�os�mkdirr�TESTFN�FileExistsError�
addCleanup�rmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr�name�fs    �=/usr/local/lib/python3.12/test/test_unicode_file_functions.py�setUpzUnicodeFileTests.setUpAs���	��H�H�Y�%�%�&�	
���	�(�(�)�*:�*:�;�����J�J�D��7�7�<�<�	� 0� 0�$�)�)�D�/�B�D��d�D�!�Q�����d��*�*�7�3�4�"��G�G�D�M��I�I�d�O����
���	��	��"�!�s�#D�5$D �	D�D� D)	c�J�|jrt|j|�S|S�N)�normal_formr)r!�ss  r$rzUnicodeFileTests.normQs#������T�-�-�q�1�1���Tc
���|j|�5}||�ddd�jj}|r'|j||d|j�d|�d|���yy#1swY�IxYw)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_failureVse���
�
�1�
2�a��x�L�3��{�{�+�+������\�8� �k�k�8�\�6C�
D��3�
2�s�	A#�#A,c��|jD]�}d|z}|jt|�|jtj|�|jtj
|�|jtj|�|jtj|�|jtj|���y)N�not_)	rr7rrr�chdir�rmdir�remove�listdir�r!r"s  r$�
test_failureszUnicodeFileTests.test_failuresas����J�J�D��D�=�D�����d�+��������.�������$�/�������$�/�����	�	�4�0�����
�
�D�1�r*�win32c�$�|jD]�}t|d�}|j|dzjd��|j	�tj|�|jt
j||j���yr
)
rrrr�closerrr7r=�_listdir_failure)r!r"r#s   r$�	test_openzUnicodeFileTests.test_openrsg���J�J�D��T�4� �A�
�G�G�T�$�Y�&�&�w�/�0�
�G�G�I��G�G�D�M�����
�
�D�$�2G�2G�H�r*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]�}|jt|�|jtj
|�|jtj|�|jtj|�|jtj|�|jtj|���y)N)�NFC�NFD�NFKC�NFKDc3�6�K�|]}t�|����y�wr'r)�.0�file�nfs  �r$�	<genexpr>z2UnicodeFileTests.test_normalize.<locals>.<genexpr>�s�����@�%�$�)�B��-�%�s�)
rrr7rrrr:r;r<r=)r!r�othersr"rMs    @r$�test_normalizezUnicodeFileTests.test_normalize~s�����D�J�J�������4�5�B��c�@�%�@�@�@�F�6��%����D�����d�+��������.�������$�/�������$�/�����	�	�4�0�����
�
�D�1�
r*c��t|j�}tj�5tjdt
�t
jtjjtj���}ddd�t
jtj�}td�|D��}|j|||�d|���|jt�t|��y#1swY�{xYw)N�ignorec3�xK�|]2}tjjtj|����4y�wr')rrrrr)rKr#s  r$rNz0UnicodeFileTests.test_listdir.<locals>.<genexpr>�s&����@�R��"�'�'�,�,�y�/�/��3�R�s�8:z != )rr�warnings�catch_warnings�simplefilter�DeprecationWarningrr=rrr�sys�getfilesystemencodingr0�len)r!�sf0�f1�f2�sf2s     r$�test_listdirzUnicodeFileTests.test_listdir�s����$�*�*�o��
�
$�
$�
&��!�!�(�,>�?����I�,�,�3�3��5�5�7�9�:�B�'��Z�Z�	�(�(�
)���@�R�@�@������c��c�#:�;�����R��#�b�'�*�'�
&�s�AD�Dc�~�|jD].}tj|d�tjd|��0y)N�tmp)rr�renamer>s  r$�test_renamezUnicodeFileTests.test_rename�s,���J�J�D��I�I�d�E�"��I�I�e�T�"�r*c��tjjtjd�}d}tj
|�5t
|d�5}|j|dzjd��ddd�tj|tj�tj|�ddd�y#1swY�KxYw#1swYyxYw)NuGrüß-曨曩曫uß-曨曩曫rrr)rrrrr�temp_cwdrrr�access�R_OKr<)r!�dirnamer/r#s    r$�test_directoryzUnicodeFileTests.test_directory�s����'�'�,�,�y�/�/�>�@��,��
�
�
��
(��h��%������D��0�0��9�:�&��I�I�h�r�w�w�'��I�I�h��	)�
(�%�%��)�
(�s%�
C
�$C�7AC
�C
	�C
�
C)r1�
__module__�__qualname__r�	filenamesrr(r%r�FileNotFoundErrorr7r?rX�platform�NotADirectoryErrorrCrD�unittest�skipIfr�
is_emscripten�is_wasirPr_rcri�r*r$rr=s����	�N�E��K�� �+<�&*�	D�	2��|�|�w��-�/@�@��-��I��X�_�_�S�\�\�X�-�/L�M��X�_�_����0����D��2�	�N�
2�"�X�_�_�S�\�\�X�-�/L�M�	+�N�	+�#�
 r*rc��eZdZdZy)�UnicodeNFCFileTestsrFN�r1rjrkr(rtr*r$rvrv�����Kr*rvc��eZdZdZy)�UnicodeNFDFileTestsrGNrwrtr*r$rzrz�rxr*rzc��eZdZdZy)�UnicodeNFKCFileTestsrHNrwrtr*r$r|r|�����Kr*r|c��eZdZdZy)�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�w�)�)�*��*�*�,�J�H��D��K�K�
�#��p �x�(�(�p �f�*���*���+���+���z���H�M�M�O���Q�H��h���!G�H�	H�H�s�1C#�#C;

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