Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_unicode_file.cpython-39.pyc

a

��g��	@s�ddlZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZej
js�ze
�e	�Wn eefy�e�d��Yn0dd�ZGdd�dej�Zedkr�e��dS)	�N)�rmtree�
change_cwd�TESTFN_ENCODING�TESTFN_UNICODE�TESTFN_UNENCODABLE�create_empty_filez1No Unicode filesystem semantics on this platform.cCstj�|�rt�|�dS�N)�os�path�exists�unlink)�filename�r�2/usr/local/lib/python3.9/test/test_unicode_file.py�remove_if_existssrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestUnicodeFilesc
Cs>|�tj�|��|�tj�|��|�t�|tj��|�tj�tj�|���|�tj�tj�|���|�t�tj�|�tj��t�|d�t�	|d�t�	|t
�
�t
�
�f�|�||�|�tj�|�tj�t�t�
|��d�k�tj�tj�|��\}}t�|�}t�d|�}dd�|D�}|�||�dS)Ni�r�NFDcSsg|]}t�d|��qS)r)�unicodedata�	normalize)�.0�frrr�
<listcomp>2�z/TestUnicodeFiles._do_single.<locals>.<listcomp>)�
assertTruer	r
r�isfile�access�R_OK�abspath�chmod�utime�time�_do_copyish�glob�escape�split�listdirrrZassertIn)�selfr
r
�baseZ	file_listrrr�
_do_singles$&�
zTestUnicodeFiles._do_singlecCs^|�tj�|��t�||d�|�tj�|��|�tj�|d��t�|d|�|�tj�|d��|�tj�|��t�||d�t�|d�t�	||d�|�tj�
|��|�tj�
|d��t�	|d|�|�tj�
|d��|�tj�
|��t�||d�|�tj�|d��t�|d�|�tj�
|d��dS)Nz.new)rr	r
r�renameZassertFalse�shutil�copyr�mover�copy2)r&Z	filename1�	filename2rrrr!7s&zTestUnicodeFiles._do_copyishc	Cs�tj�|�rt|�t�|�znt|��Ht��}|}t�d|�}t�d|�}|�	tj�
|�|�Wd�n1sv0YWt�|�nt�|�0dS)Nr)r	r
�isdirr�mkdirr�getcwdrrZassertEqual�basename�rmdir)r&Z	make_nameZ
chdir_nameZ
cwd_resultZname_resultrrr�
_do_directoryTs

4zTestUnicodeFiles._do_directoryc	Cs�t|�t|�z|�|�Wt�|�nt�|�0|�tj�|��t�|tj	�}t�
|�z|�|�Wt�|�nt�|�0dSr)rrr(r	rrr
r�open�O_CREAT�close)r&r
rrrr�_test_singlefs
zTestUnicodeFiles._test_singlecCs |�t�tdur|�t�dSr)r8rr)r&rrr�test_single_filesxs
z"TestUnicodeFiles.test_single_filescCs8d}|�t|t|�tdur4|�t|t|�dS)Nz.dir)r4rr)r&�extrrr�test_directories}s
�z!TestUnicodeFiles.test_directoriesN)	�__name__�
__module__�__qualname__r(r!r4r8r9r;rrrrrsr�__main__)r	r"r r*rZunittestZtest.supportrrrrrrr
�supports_unicode_filenames�encode�UnicodeError�	TypeErrorZSkipTestrZTestCaserr<�mainrrrr�<module>s  r

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