Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/test/__pycache__/test_unicode_file.cpython-34.pyc

�
f f��@sddlZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
Z
ejjs�yeje
�Wq�eefk
r�ejd��Yq�Xndd�ZGdd�dej�Zdd	�Zed
kr
e�ndS)�N)�run_unittest�rmtree�
change_cwd�TESTFN_ENCODING�TESTFN_UNICODE�TESTFN_UNENCODABLE�create_empty_filez1No Unicode filesystem semantics on this platform.cCs&tjj|�r"tj|�ndS)N)�os�path�exists�unlink)�filename�r�;/opt/alt/python34/lib64/python3.4/test/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ZmoverZcopy2)r$Z	filename1�	filename2rrrr 7s&zTestUnicodeFiles._do_copyishcCs�tjj|�rt|�ntj|�zit|��Wtj�}|}tjd|�}tjd|�}|j	tjj
|�|�WdQXWdtj|�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�ndS)N)r4rr)r$rrr�test_single_filesxs
z"TestUnicodeFiles.test_single_filescCsId}|jt|t|�tdk	rE|jt|t|�ndS)Nz.dir)r0rr)r$Zextrrr�test_directories}s

z!TestUnicodeFiles.test_directoriesN)	�__name__�
__module__�__qualname__r&r r0r4r5r6rrrrrsrcCstt�dS)N)rr7rrrr�	test_main�sr:�__main__)r	r!rr(rZunittestZtest.supportrrrrrrrr
�supports_unicode_filenames�encode�UnicodeError�	TypeErrorZSkipTestrZTestCaserr:r7rrrr�<module>s04q