HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_unicode_file_functions.cpython-310.opt-1.pyc
o

�i��@sddlZddlZddlZddlZddlmZddlmZgd�Zej	dkr,e�
gd��ejjsMe�
�ZzeD]Ze�e�q7WneyLe�d��wGdd	�d	ej�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�Zedkr�e��dSdS)�N��	normalize)�	os_helper)
Z1_abcZ2_asciiu
3_Grüß-Gottu4_Γειά-σαςu5_Здравствуйтеu6_にぽんu7_השקצץסu8_曨曩曫u9_曨שんдΓßu	10_΅´�darwin)	u	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	dfdd�Z
d	d
�Zej
dkr'ee	fZneZdd
�Ze�ej
dkd�dd��Ze�ej
dkd�dd��Zdd�Zdd�ZdS)�UnicodeFileTestsNc	Cs�zt�tj�Wn	tyYnw|�tjtj�t�}|jD]6}tj	�
tj|�|��}t|d��}|�
|d�d��Wd�n1sGwYt�|�|�|�q ||_dS�N�wb�
�utf-8)�os�mkdirr�TESTFN�FileExistsErrorZ
addCleanup�rmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr�name�f�r�=/usr/local/lib/python3.10/test/test_unicode_file_functions.py�setUp@s�
�

zUnicodeFileTests.setUpcCs|jr	t|j|�S|S�N)�normal_formr)r�srrrrPszUnicodeFileTests.normTcCs`|�|��}||�Wd�n1swY|jj}|r.|�||d|j||f�dSdS)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_failureUs
�


��zUnicodeFileTests._apply_failurecCsj|jD]/}d|}|�t|�|�tj|�|�tj|�|�tj|�|�tj|�|�tj|�qdS)N�not_)	rr)rrr�chdir�rmdir�remove�listdir�rrrrr�
test_failures`s
�zUnicodeFileTests.test_failures�win32cCsR|jD]#}t|d�}|�|d�d��|��t�|�|�tj||j	�qdSr)
rrrr�closerrr)r.�_listdir_failure)rrrrrr�	test_openqs


�zUnicodeFileTests.test_openrzirrelevant test on Mac OS Xcs�t|j�}t�}tgd��D]�|t�fdd�|D��O}q||8}|D]+}|�t|�|�tj|�|�tj|�|�tj|�|�tj|�|�tj	|�q$dS)N)�NFC�NFD�NFKC�NFKDc3s�|]}t�|�VqdSr r)�.0�file�Znfrr�	<genexpr>�s�z2UnicodeFileTests.test_normalize.<locals>.<genexpr>)
rrr)rrrr+r,r-r.)rrZothersrrr;r�test_normalize}s
�zUnicodeFileTests.test_normalizecCs�t|j�}t���t�dt�t�tj	�
t����}Wd�n1s%wYt�tj	�}tdd�|D��}|�
||d||f�|�
t|�t|��dS)N�ignorecss �|]}tj�tj|�VqdSr )rrrrr
)r9rrrrr<�s�z0UnicodeFileTests.test_listdir.<locals>.<genexpr>z%a != %a)rr�warnings�catch_warnings�simplefilter�DeprecationWarningrr.rr
r�sys�getfilesystemencodingr%�len)rZsf0�f1�f2Zsf2rrr�test_listdir�s


��zUnicodeFileTests.test_listdircCs(|jD]}t�|d�t�d|�qdS)N�tmp)rr�renamer/rrr�test_rename�s
�zUnicodeFileTests.test_renamec	Cs�tj�tjd�}d}t�|��4t|d��}|�|d�d��Wd�n1s*wYt�	|tj
�t�|�Wd�dS1sFwYdS)NuGrüß-曨曩曫uß-曨曩曫rr	r
)rrrrr
Ztemp_cwdrrr�access�R_OKr-)r�dirnamer$rrrr�test_directory�s
��"�zUnicodeFileTests.test_directory)r&�
__module__�__qualname__r�	filenamesrr!rr�FileNotFoundErrorr)r0rC�platform�NotADirectoryErrorr3r4�unittestZskipIfr=rHrKrOrrrrr<s&
�



rc@�eZdZdZdS)�UnicodeNFCFileTestsr5N�r&rPrQr!rrrrrX��rXc@rW)�UnicodeNFDFileTestsr6NrYrrrrr[�rZr[c@rW)�UnicodeNFKCFileTestsr7NrYrrrrr\�rZr\c@rW)�UnicodeNFKDFileTestsr8NrYrrrrr]�rZr]�__main__)rrCrVr?�unicodedatarZtest.supportrrRrT�extendr�supports_unicode_filenamesrDZ
fsencodingrr�UnicodeEncodeErrorZSkipTestZTestCaserrXr[r\r]r&�mainrrrr�<module>s4
�
�o�