o
    1< i¾  ã                   @   s:   d dl Z d dlZd dlZdd„ Zej dd¡dd„ ƒZdS )é    Nc                 C   sl   |   d¡}| d¡ |   d¡}t d¡}t t¡ | t|ƒt|ƒ¡ W d   ƒ d S 1 s/w   Y  d S )Núsource_file.txtÚcontentz+non_existent_directory/destination_file.txtÚfile)	ÚjoinÚwriteÚfsspecÚ
filesystemÚpytestÚraisesÚFileNotFoundErrorÚmvÚstr)ÚtmpdirÚsourceÚdestinationÚfs© r   úS/home/app/PyTorch/.pytorch/lib/python3.10/site-packages/fsspec/tests/abstract/mv.pyÚ"test_move_raises_error_with_tmpdir   s   



"ÿr   Ú	recursive)TFc                 C   sæ   |  d¡}| d¡ | d¡}t|ƒ}tjdkr"t d|› d¡ nt |d¡ |  d¡}t 	d	¡}t
 t¡ |jt|ƒt|ƒ| d
 W d   ƒ n1 sNw   Y  tj |¡r[J ‚tjdkrkt d|› d¡ d S t |d¡ d S )Nr   r   Zprotected_directoryÚntzicacls "z" /deny Everyone:(W)im  zdestination_file.txtr   )r   z" /remove:d Everyoneií  )r   r   Úmkdirr   ÚosÚnameÚsystemÚchmodr   r   r	   r
   ÚPermissionErrorr   ÚpathÚexists)r   r   r   Zprotected_dirZprotected_pathr   r   r   r   r   Ú-test_move_raises_error_with_tmpdir_permission   s    





ÿ
r   )r   r	   r   r   ÚmarkZparametrizer   r   r   r   r   Ú<module>   s    