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_pep277.cpython-35.opt-2.pyc



���]_�@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
addCleanup�rmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr�name�f�r�0/opt/alt/python35/lib64/python3.5/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assertRaises�	exception�filename�assertEqual�__name__)r�fnr Zexpected_exceptionZcheck_filename�cZexc_filenamerrr�_apply_failureTszUnicodeFileTests._apply_failurecCs�x�|jD]}d|}|jt|�|jtj|�|jtj|�|jtj|�|jtj|�|jtj|�q
WdS)N�not_)	rr%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)
rrrr�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
rr%rrrr'r(r)r*)rrZothersrr)r6r�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
)r4rrrrr7�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)N�tmp)rr�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�dirnamer rrrr�test_directory�s!zUnicodeFileTests.test_directory)r"�
__module__�__qualname__r
�	filenamesrrrr�FileNotFoundErrorr%r+r>�platform�NotADirectoryErrorr.r/�unittestZskipIfr8rCrFrJrrrrr;s	''rc@seZdZdZdS)�UnicodeNFCFileTestsr0N)r"rKrLrrrrrrR�srRc@seZdZdZdS)�UnicodeNFDFileTestsr1N)r"rKrLrrrrrrS�srSc@seZdZdZdS)�UnicodeNFKCFileTestsr2N)r"rKrLrrrrrrT�srTc@seZdZdZdS)�UnicodeNFKDFileTestsr3N)r"rKrLrrrrrrU�srUcCstjttttt�dS)N)rZrun_unittestrrRrSrTrUrrrr�	test_main�srV�__main__)rr>rQr:ZunicodedatarZtestrrMrO�extendr�supports_unicode_filenamesr?Z
fsencodingrr�UnicodeEncodeErrorZSkipTestZTestCaserrRrSrTrUrVr"rrrr�<module>sR		


m