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/test_importlib/__pycache__/test_reader.cpython-310.opt-1.pyc
o

�i��@sxddlZddlZddlZddlZddlmZddlmZm	Z	Gdd�dej
�ZGdd�dej
�Ze
dkr:e��dSdS)	�N)�
import_module)�MultiplexedPath�NamespaceReaderc@sheZdZedd��Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)�MultiplexedPathTestcCst�t�jd}t|�|_dS)N�namespacedata01)�pathlib�Path�__file__�parent�str�folder)�cls�path�r�</usr/local/lib/python3.10/test/test_importlib/test_reader.py�
setUpClassszMultiplexedPathTest.setUpClasscCs6|�t��t�Wd�dS1swYdS�N)�assertRaises�FileNotFoundErrorr��selfrrr�test_init_no_pathss"�z&MultiplexedPathTest.test_init_no_pathscCsD|�t��ttj�|jd��Wd�dS1swYdS)N�binary.file)r�NotADirectoryErrorr�osr�joinrrrrr�test_init_files"�z"MultiplexedPathTest.test_init_filec	CsRdd�t|j���D�}z|�d�WnttfyYnw|�|hd��dS)NcS�h|]}|j�qSr��name��.0rrrr�	<setcomp>sz3MultiplexedPathTest.test_iterdir.<locals>.<setcomp>�__pycache__>�
utf-8.file�utf-16.filer)rr�iterdir�remove�KeyError�
ValueError�assertEqual)r�contentsrrr�test_iterdirs�z MultiplexedPathTest.test_iterdirc
Csttj�tj�tdd��}dd�t|j|���D�}dD]}z|�|�Wqt	t
fy/Yqw|�|hd��dS)N�..�data01cSrrrr rrrr""s�z=MultiplexedPathTest.test_iterdir_duplicate.<locals>.<setcomp>)r#z__init__.pyc>r%rr$z__init__.py�subdirectory)rr�abspathrr	rrr&r'r(r)r*)rr.r+r'rrr�test_iterdir_duplicate s���z*MultiplexedPathTest.test_iterdir_duplicatecC�|�t|j���d�dS)NT)r*rr�is_dirrrrr�test_is_dir/�zMultiplexedPathTest.test_is_dircCr2)NF)r*rr�is_filerrrr�test_is_file2r5z MultiplexedPathTest.test_is_filecCs�t|j�}|�t��|��Wd�n1swY|�t��|��Wd�n1s2wY|�t��
|��Wd�dS1sLwYdSr)rrrr�
read_bytes�	read_text�open)rrrrr�test_open_file5s

�
�
"�z"MultiplexedPathTest.test_open_filecCs�tj�tj�td��}tj�|d�}t|j|�}|�t|�	d��t
|�dd�tj�dd��|�t|�	d��t
|�dd�tj�dd��|�t|�	d��t
|�dd�tj�dd��dS)Nr-r.r�rr/�	imaginary)rrr0rr	rrr*r�joinpath�len)r�prefixr.rrrr�test_join_path>s���z"MultiplexedPathTest.test_join_pathcCs$|�tt|j��d|j�d��dS)N�MultiplexedPath('�'))r*�reprrrrrrr�	test_reprOs�zMultiplexedPathTest.test_reprcCs"|�t|j�jtj�|j��dSr)r*rrrrr�basenamerrrr�	test_nameUs
�zMultiplexedPathTest.test_nameN)�__name__�
__module__�__qualname__�classmethodrrrr,r1r4r7r;rArErGrrrrr
s
	rc@sLeZdZee�e�j�Ze	dd��Z
e	dd��Zdd�Zdd�Z
d	d
�ZdS)�NamespaceReaderTestcC�tj�|j�dSr)�sysr�append�site_dir�r
rrrr_�zNamespaceReaderTest.setUpClasscCrMr)rNrr'rPrQrrr�
tearDownClasscrRz!NamespaceReaderTest.tearDownClasscCs<|�t��tddg�Wd�dS1swYdS)NZpath1Zpath2)rr)rrrrr�test_init_errorgs"�z#NamespaceReaderTest.test_init_errorcCshtd�}t|jj�}tj�tj�tdd��}|�	|�
d�tj�|d��|�	|�
d�tj�|d��dS)Nrr-rr=)rr�__spec__�submodule_search_locationsrrr0rr	r*Z
resource_path�rr�reader�rootrrr�test_resource_pathks��z&NamespaceReaderTest.test_resource_pathcCs\td�}t|jj�}tj�tj�tdd��}|�	|�
�t�|�t
|�
��d|�d��dS)Nrr-rBrC)rrrUrVrrr0rr	ZassertIsInstance�filesrr*rDrWrrr�
test_filesws
 zNamespaceReaderTest.test_filesN)rHrIrJrrrr	r
rPrKrrSrTrZr\rrrrrL\s

rL�__main__)Zos.pathrrNrZunittest�	importlibr�importlib.readersrrZTestCaserrLrH�mainrrrr�<module>sR#�