Your IP : 216.73.216.85


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_unicode_file.cpython-35.opt-2.pyc



���]��@sddlZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
Z
ejjs�yeje
�Wn'eefk
r�ejd��YnXdd�ZGdd�dej�Zdd	�Zed
kre�dS)�N)�run_unittest�rmtree�
change_cwd�TESTFN_ENCODING�TESTFN_UNICODE�TESTFN_UNENCODABLE�create_empty_filez1No Unicode filesystem semantics on this platform.cCs#tjj|�rtj|�dS)N)�os�path�exists�unlink)�filename�r�6/opt/alt/python35/lib64/python3.5/test_unicode_file.py�remove_if_existssrc@sXeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestUnicodeFilescCs�|jtjj|��|jtjj|��|jtj|tj��|jtjjtjj|���|jtjjtjj|���|jtjtjj|�tj��tj|d�tj	|d�tj	|t
j
�t
j
�f�|j||�|jtjj|�tjjtj|�d�k�tjj
tjj|��\}}tj|�}tjd|�}dd�|D�}|j||�dS)Ni�r�NFDcSs"g|]}tjd|��qS)r)�unicodedata�	normalize)�.0�frrr�
<listcomp>2s	z/TestUnicodeFiles._do_single.<locals>.<listcomp>)�
assertTruer	r
r�isfile�access�R_OK�abspath�chmod�utime�time�_do_copyish�glob�split�listdirrrZassertIn)�selfr
r
�baseZ	file_listrrr�
_do_singles"%%("2$zTestUnicodeFiles._do_singlecCs�|jtjj|��tj||d�|jtjj|��|jtjj|d��tj|d|�|jtjj|d��|jtjj|��tj||d�tj|d�tj	||d�|jtjj
|��|jtjj
|d��tj	|d|�|jtjj
|d��|jtjj
|��tj||d�|jtjj|d��tj|d�|jtjj
|d��dS)Nz.new)rr	r
r�renameZassertFalse�shutil�copyr�mover�copy2)r$Z	filename1�	filename2rrrr 7s&zTestUnicodeFiles._do_copyishcCs�tjj|�rt|�tj|�zjt|��Wtj�}|}tjd|�}tjd|�}|j	tjj
|�|�WdQRXWdtj|�XdS)Nr)r	r
�isdirr�mkdirr�getcwdrrZassertEqual�basename�rmdir)r$Z	make_nameZ
chdir_nameZ
cwd_resultZname_resultrrr�
_do_directoryTs


'zTestUnicodeFiles._do_directorycCs�t|�t|�z|j|�Wdtj|�X|jtjj|��tj|tj	�}tj
|�z|j|�Wdtj|�XdS)N)rrr&r	rrr
r�open�O_CREAT�close)r$r
rrrr�_test_singlefs


zTestUnicodeFiles._test_singlecCs*|jt�tdk	r&|jt�dS)N)r6rr)r$rrr�test_single_filesxs
z"TestUnicodeFiles.test_single_filescCsFd}|jt|t|�tdk	rB|jt|t|�dS)Nz.dir)r2rr)r$�extrrr�test_directories}s

z!TestUnicodeFiles.test_directoriesN)	�__name__�
__module__�__qualname__r&r r2r6r7r9rrrrrsrcCstt�dS)N)rr:rrrr�	test_main�sr=�__main__)r	r!rr(rZunittestZtest.supportrrrrrrrr
�supports_unicode_filenames�encode�UnicodeError�	TypeErrorZSkipTestrZTestCaserr=r:rrrr�<module>s04q