HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/distutils/tests/__pycache__/test_file_util.cpython-310.opt-1.pyc
o

�i`�@s�dZddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZGd
d�dejej�Zdd
�ZedkrTee��dSdS)zTests for distutils.file_util.�N)�patch)�	move_file�	copy_file)�log)�support)�DistutilsFileError)�run_unittest)�unlinkcsXeZdZdd�Z�fdd�Z�fdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�FileUtilTestCasecGs0t|�dkr|j�||�dS|j�|�dS)Nr)�len�_logs�append)�self�msg�args�r�;/usr/local/lib/python3.10/distutils/tests/test_file_util.py�_logszFileUtilTestCase._logcs`tt|���g|_tj|_|jt_|��}t	j
�|d�|_t	j
�|d�|_
t	j
�|d�|_dS)N�f1�f2Zd1)�superr
�setUprr�info�old_logr�mkdtemp�os�path�join�source�target�
target_dir)rZtmp_dir��	__class__rrrszFileUtilTestCase.setUpcs|jt_tt|���dS�N)rrrrr
�tearDown)rr!rrr$!szFileUtilTestCase.tearDowncCs�t|jd�}z|�d�W|��n|��wt|j|jdd�g}|�|j|�t|j|jdd�t|j|jdd�d|j|jfg}|�|j|�t|j|jdd�g|_t�	|j
�t|j|j
dd�d|j|j
fg}|�|j|�dS)N�w�some contentr��verbose�zmoving %s -> %s)�openr�write�closerr�assertEqualrr�mkdirr )r�fZwantedrrr�test_move_file_verbosity%s"z)FileUtilTestCase.test_move_file_verbosityc
Cs�tdtdd�d��J|�t��,t|jd��
}|�d�Wd�n1s&wYt|j|jdd�Wd�n1s>wYWd�dSWd�dS1sVwYdS)	N�	os.rename�wrongr)�Zside_effectr%�	spam eggsrr')	r�OSError�assertRaisesrr*rr+rr�rZfobjrrr�)test_move_file_exception_unpacking_renameAs��P�z:FileUtilTestCase.test_move_file_exception_unpacking_renamecCs�tdttjd�d��ctdtdd�d��A|�t��,t|jd��
}|�d�Wd�n1s1wYt	|j|j
dd	�Wd�n1sIwYWd�n1sXwYWd�dSWd�dS1spwYdS)
Nr1r2r3z	os.unlinkr)r%r4rr')rr5�errnoZEXDEVr6rr*rr+rrr7rrr�)test_move_file_exception_unpacking_unlinkIs�����Pz:FileUtilTestCase.test_move_file_exception_unpacking_unlinkc
Cs4t|jd��
}|�d�Wd�n1swYz
t�|j|j�Wnty>}z
|�d|�WYd}~n
d}~wwt|j�t�	|j�}t
|j|jdd�t�	|j�}t�	|j�}|�tj�
||�||f�|�tj�
||�||f�t|jd��}|�|��d�Wd�dS1s�wYdS)Nr%r&zos.link: %s�hard��link�r)r*rr+rr=rr5ZskipTestr	�statr�
assertTruer�samestatr-�read)rr/�e�st�st2�st3rrr�test_copy_file_hard_linkRs&���
"�z)FileUtilTestCase.test_copy_file_hard_linkc	Cs"t|jd��
}|�d�Wd�n1swYt�|j�}tdtdd�d��t|j|jdd�Wd�n1s>wYt�|j�}t�|j�}|�	tj
�||�||f�|�tj
�||�||f�|j|jfD]}t|d	��}|�
|��d�Wd�n1s�wYqodS)
Nr%r&zos.linkrzlinking unsupportedr3r;r<r>)r*rr+rr?rr5rrr@rrAZassertFalser-rB)rr/rDrErF�fnrrr� test_copy_file_hard_link_failurefs"�����z1FileUtilTestCase.test_copy_file_hard_link_failure)�__name__�
__module__�__qualname__rrr$r0r8r:rGrI�
__classcell__rrr!rr
s
	r
cCs
t�t�Sr#)�unittestZ	makeSuiter
rrrr�
test_suitexs
rO�__main__)�__doc__rNrr9Z
unittest.mockrZdistutils.file_utilrrZ	distutilsrZdistutils.testsrZdistutils.errorsrZtest.supportrZtest.support.os_helperr	ZTempdirManagerZTestCaser
rOrJrrrr�<module>s i�