Your IP : 216.73.216.213


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



��Yf_�@s�ddlZddlZddlZddlZddlmZddlmZdddddd	d
ddd
g
Zej	dkr�ej
dddddddddg	�ejjs	ej
�Zy"xeD]Zeje�q�WWn!ek
rejd��YnXGdd�dej�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�Zd#d$�Zed%kr�e�dS)&�N)�	normalize)�supportZ1_abcZ2_asciiu
3_Grüß-Gottu4_Γειά-σαςu5_Здравствуйтеu6_にぽんu7_השקצץסu8_曨曩曫u9_曨שんдΓßu	10_΅´�darwinu	11_΅ϓϔu12_΅ϓϔu13_ ̈́ΎΫu14_ẛ῁῍῎῏῝῞῟῭u15_΅´𣏕u
16_   Au
17_   Au
18_   Az19_   Az>only NT+ and systems with Unicode-friendly filesystem encodingc@s�eZdZee�ZdZdd�Zdd�Ze	ddd�Z
d	d
�Zej
dkrree	fZneZdd
�Zejej
dkd�dd��Zejej
dkd�dd��Zdd�Zdd�ZdS)�UnicodeFileTestsNcCs�ytjtj�Wntk
r(YnX|jtjtj�t�}x|jD]t}tj	j
tj|j|��}t|d��!}|j
|djd��WdQRXtj|�|j|�qRW||_dS)N�wb�
zutf-8)�os�mkdirr�TESTFN�FileExistsErrorZ
addCleanupZrmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr
�name�f�r�5/opt/alt/python35/lib64/python3.5/test/test_pep277.py�setUp?s
	!!
zUnicodeFileTests.setUpcCs|jrt|j|�S|S)N)�normal_formr)r�srrrrOs	zUnicodeFileTests.normTcCs\|j|��}||�WdQRX|jj}|rX|j||d|j||f�dS)Nz>Function '%s(%a) failed with bad filename in the exception: %a)ZassertRaisesZ	exception�filename�assertEqual�__name__)r�fnrZexpected_exceptionZcheck_filename�cZexc_filenamerrr�_apply_failureTszUnicodeFileTests._apply_failurecCs�x�|jD]}d|}|jt|�|jtj|�|jtj|�|jtj|�|jtj|�|jtj|�q
WdS)N�not_)	r
r#rrr�chdir�rmdir�remove�listdir)rrrrr�
test_failures_s
zUnicodeFileTests.test_failures�win32cCsqxj|jD]_}t|d�}|j|djd��|j�tj|�|jtj||j	�q
WdS)Nrrzutf-8)
r
rrr�closerrr#r(�_listdir_failure)rrrrrr�	test_openps

zUnicodeFileTests.test_openrzirrelevant test on Mac OS Xcs�t|j�}t�}xCtddddg�D])�|t�fdd�|D��O}q1W||8}x}|D]u}|jt|�|jtj|�|jtj|�|jtj|�|jtj|�|jtj	|�qoWdS)N�NFC�NFD�NFKC�NFKDc3s|]}t�|�VqdS)N)r)�.0�file)�nfrr�	<genexpr>�sz2UnicodeFileTests.test_normalize.<locals>.<genexpr>)
rr
r#rrrr%r&r'r()rr
Zothersrr)r4r�test_normalize|s	'

zUnicodeFileTests.test_normalizec
Cs�t|j�}tj��6tjdt�tjtj	j
tj���}WdQRXtjtj	�}tdd�|D��}|j
||d||f�|j
t|�t|��dS)N�ignorecss'|]}tjjtj|�VqdS)N)rrrrr
)r2rrrrr5�sz0UnicodeFileTests.test_listdir.<locals>.<genexpr>z%a != %a)rr
�warnings�catch_warnings�simplefilter�DeprecationWarningrr(rr
r�sys�getfilesystemencodingr�len)rZsf0�f1�f2Zsf2rrr�test_listdir�s
(zUnicodeFileTests.test_listdircCs8x1|jD]&}tj|d�tjd|�q
WdS)NZtmp)r
r�rename)rrrrr�test_rename�szUnicodeFileTests.test_renamecCs�tjjtjd�}d}tj|��Xt|d��!}|j|djd��WdQRXtj	|tj
�tj|�WdQRXdS)NuGrüß-曨曩曫uß-曨曩曫rrzutf-8)rrrrr
Ztemp_cwdrrr�access�R_OKr')r�dirnamerrrrr�test_directory�s!zUnicodeFileTests.test_directory)r �
__module__�__qualname__r�	filenamesr
rrr�FileNotFoundErrorr#r)r<�platform�NotADirectoryErrorr,r-�unittestZskipIfr6rArCrGrrrrr;s	''rc@seZdZdZdS)�UnicodeNFCFileTestsr.N)r rHrIrrrrrrO�srOc@seZdZdZdS)�UnicodeNFDFileTestsr/N)r rHrIrrrrrrP�srPc@seZdZdZdS)�UnicodeNFKCFileTestsr0N)r rHrIrrrrrrQ�srQc@seZdZdZdS)�UnicodeNFKDFileTestsr1N)r rHrIrrrrrrR�srRcCstjttttt�dS)N)rZrun_unittestrrOrPrQrRrrrr�	test_main�srS�__main__)rr<rNr8ZunicodedatarZtestrrJrL�extendr�supports_unicode_filenamesr=Z
fsencodingrr�UnicodeEncodeErrorZSkipTestZTestCaserrOrPrQrRrSr rrrr�<module>sR		


m