Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.11/distutils/tests/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.11/distutils/tests/__pycache__/test_dir_util.cpython-311.pyc

�

SԚgX����dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZddlmZmZGd	�d
ejej��Zedkrej��dSdS)zTests for distutils.dir_util.�N)�patch)�dir_util�errors)�mkpath�remove_tree�create_tree�	copy_tree�ensure_relative)�log)�support)�
is_emscripten�is_wasic����eZdZd�Z�fd�Z�fd�Zd�Zeje	j
�d��d��ejepe
d��d�����Zd	�Zd
�Zd�Zd�Zd
�Z�xZS)�DirUtilTestCasec��t|��dkr|j�||z��dS|j�|��dS)Nr)�len�_logs�append)�self�msg�argss   �:/usr/local/lib/python3.11/distutils/tests/test_dir_util.py�_logzDirUtilTestCase._logsM���t�9�9�q�=�=��J���c�D�j�)�)�)�)�)��J���c�"�"�"�"�"�c���tt|�����g|_|���}t
j�|d��|_t
j�|jd��|_	t
j�|d��|_
tj|_
|jt_dS)N�deep�here�deep2)�superr�setUpr�mkdtemp�os�path�join�root_target�target�target2r�info�old_logr)r�tmp_dir�	__class__s  �rr zDirUtilTestCase.setUps����
�o�t�$�$�*�*�,�,�,���
��,�,�.�.���7�<�<���8�8����g�l�l�4�#3�V�<�<����w�|�|�G�W�5�5����x����9����rc�x��|jt_tt|�����dS)N)r)rr(rr�tearDown)rr+s �rr-zDirUtilTestCase.tearDown#s.����<���
�o�t�$�$�-�-�/�/�/�/�/rc��t|jd���g}|�|j|��t	|jd���t|jd���d|jzd|jzg}|�|j|��g|_t	|jd���d|jzg}|�|j|��dS)Nr��verbose��creating %sz'removing '%s' (and everything under it))rr&�assertEqualrrr%�r�wanteds  r�!test_mkpath_remove_tree_verbosityz1DirUtilTestCase.test_mkpath_remove_tree_verbosity's����t�{�A�&�&�&�&��������V�,�,�,��D�$�a�0�0�0�0��t�{�A�&�&�&�&��$�"2�2��$�+�-�/�������V�,�,�,���
��D�$�a�0�0�0�0�;�d�>N�N�O�������V�,�,�,�,�,r�winz5This test is only appropriate for POSIX-like systems.z$Emscripten's/WASI's umask is a stub.c���tjd��}tj|��t|jd��|�tjtj|j��j��d|z��t|jd��|�tjtj|j��j��d|z��dS)N�i�im)	r"�umaskrr&r3�stat�S_IMODE�st_moder')rr:s  r�test_mkpath_with_custom_modez,DirUtilTestCase.test_mkpath_with_custom_mode8s���������
�������t�{�E�"�"�"�����L�����-�-�5�6�6�����	H�	H�	H��t�|�U�#�#�#�����L�����.�.�6�7�7��%���	I�	I�	I�	I�	Irc�D�t|jgd�d���|�|jg��t	|jd���d|jzg}t|jgd�d���|�|j|��t	|jd���dS)N)�one�two�threerr/r2r1)rr%r3rrr4s  r�test_create_tree_verbosityz*DirUtilTestCase.test_create_tree_verbosityIs����D�$�&=�&=�&=�q�I�I�I�I������R�(�(�(��D�$�a�0�0�0�0��$�"2�2�3���D�$�&=�&=�&=�q�I�I�I�I������V�,�,�,��D�$�a�0�0�0�0�0�0rc��t|jd���t|j|jd���|�|jg��t
|jd���t|jd���tj	�
|jd��}t|d��5}|�d��ddd��n#1swxYwYd|�d|j��g}t|j|jd���|�|j|��t
|jd���t
|jd���dS)	Nrr/�ok.txt�w�some contentzcopying z -> r1)
rr&r	r'r3rrr%r"r#r$�open�write)r�a_file�fr5s    r�test_copy_tree_verbosityz(DirUtilTestCase.test_copy_tree_verbosityUsx���t�{�A�&�&�&�&��$�+�t�|�Q�7�7�7�7������R�(�(�(��D�$�a�0�0�0�0��t�{�A�&�&�&�&�����d�k�8�4�4��
�&�#�
�
�	$�!�
�G�G�N�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$��)/������=�>���$�+�t�|�Q�7�7�7�7������V�,�,�,��D�$�a�0�0�0�0��D�L�!�,�,�,�,�,�,s�/C�C�Cc�6�t|jd���tj�|jd��}tj�|jd��}||fD]?}t|d��5}|�d��ddd��n#1swxYwY�@t|j|j��|�	tj
|j��dg��t|jd���t|jd���dS)Nrr/rEz
.nfs123abcrFrG)
rr&r"r#r$rHrIr	r'r3�listdirrr%)rrJ�nfs_filerK�fhs     r�#test_copy_tree_skips_nfs_temp_filesz3DirUtilTestCase.test_copy_tree_skips_nfs_temp_filesjs7���t�{�A�&�&�&�&�����d�k�8�4�4���7�<�<���\�:�:����!�	)�	)�A��a����
)������(�(�(�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)��	�$�+�t�|�,�,�,������D�L�1�1�H�:�>�>�>��D�$�a�0�0�0�0��D�L�!�,�,�,�,�,�,s�7B�B	� B	c�B�tjdkrH|�td��d��|�td��d��dS|�td��d��|�td��d��dS)N�/z	/home/foozhome/fooz	some/pathzc:\home\fooz
c:home\foozhome\foo)r"�sepr3r
)rs r�test_ensure_relativez$DirUtilTestCase.test_ensure_relativeys���
�6�S�=�=����_�[�9�9�:�F�F�F����_�[�9�9�;�G�G�G�G�G����_�_�=�=�}�M�M�M����_�[�9�9�;�G�G�G�G�Grc�$�tdt�����5|�tj��5|jd}t
j|d��ddd��n#1swxYwYddd��dS#1swxYwYdS)zK
        An exception in listdir should raise a DistutilsFileError
        z
os.listdir)�side_effect���N)r�OSError�assertRaisesr�DistutilsFileError�tempdirsrr	)r�srcs  r�#test_copy_tree_exception_in_listdirz3DirUtilTestCase.test_copy_tree_exception_in_listdir�s
���<�W�Y�Y�
7�
7�
7�	*�	*�
�
�
�v�8�
9�
9�	*�	*��-��#�C���s�D�)�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s4� B�#A-�!B�-A1	�1B�4A1	�5B�B	�B	)�__name__�
__module__�__qualname__rr r-r6�unittest�skipIf�sys�platform�
startswithr
rr>rCrLrQrUr^�
__classcell__)r+s@rrrs+�������#�#�#������0�0�0�0�0�-�-�-�"�X�_�S�\�,�,�U�3�3�?�A�A��X�_�� ��.���	I�	I�	��A�A�	I�
1�
1�
1�-�-�-�*
-�
-�
-�H�H�H�*�*�*�*�*�*�*rr�__main__)�__doc__rbr"r;rd�
unittest.mockr�	distutilsrr�distutils.dir_utilrrrr	r
r�distutils.testsr�test.supportr
r�TempdirManager�TestCaserr_�main�rr�<module>rss>��#�#�����	�	�	�	�����
�
�
�
�������&�&�&�&�&�&�&�&�1�1�1�1�1�1�1�1�1�1�1�1�1�1�������#�#�#�#�#�#�/�/�/�/�/�/�/�/�w*�w*�w*�w*�w*�g�,�h�.?�w*�w*�w*�t�z����H�M�O�O�O�O�O��r

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