a
    yn„f¾  ã                   @   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   sj   |   d¡}| d¡ |   d¡}t d¡}t t¡�$ | t|ƒt|ƒ¡ W d   ƒ n1 s\0    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   ú[/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/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rDt d|› d�¡ nt |d¡ |  d¡}t 	d	¡}t
 t¡�( |jt|ƒt|ƒ| d
� W d   ƒ n1 sœ0    Y  tj |¡r¶J ‚tjdkrÔt d|› d�¡ n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    





6
r   )r   r	   r   r   ÚmarkZparametrizer   r   r   r   r   Ú<module>   s
   