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.7/test/test_importlib/__pycache__/test_resource.cpython-37.opt-2.pyc
B

��gc�@s�ddlZddlZddlmZddlmZmZddlmZddlmZm	Z	Gdd�d�Z
Gd	d
�d
e
ej�ZGdd�de
ej
ej�ZGd
d�dej�ZGdd�dej�ZGdd�dejej�ZGdd�dejej�ZGdd�dej�Zedkr�e��dS)�N�)�data01)�	zipdata01�	zipdata02)�util)�	resources�
import_modulec@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
ResourceTestscCs|�t�|jd��dS)Nzbinary.file)�
assertTruer�is_resource�data)�self�r�=/usr/local/lib/python3.7/test/test_importlib/test_resource.py�test_is_resource_good_path
sz(ResourceTests.test_is_resource_good_pathcCs|�t�|jd��dS)Nz
not-a-file)�assertFalserrr)r
rrr�test_is_resource_missingsz&ResourceTests.test_is_resource_missingcCs|�t�|jd��dS)N�subdirectory)rrrr)r
rrr�&test_is_resource_subresource_directorysz4ResourceTests.test_is_resource_subresource_directorycCsHtt�|j��}|�d�|�d�|�d�|�|dddddh�dS)	N�__pycache__z__init__.pycz__init__.pyoz__init__.pyrz
utf-8.filezbinary.filezutf-16.file)�setr�contentsr�discard�assertEqual)r
rrrr�
test_contentss


zResourceTests.test_contentsN)�__name__�
__module__�__qualname__rrrrrrrrr	
sr	c@seZdZdd�ZdS)�ResourceDiskTestscCs
t|_dS)N)rr)r
rrr�setUp+szResourceDiskTests.setUpN)rrrrrrrrr*src@seZdZdS)�ResourceZipTestsN)rrrrrrrr /sr c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�ResourceLoaderTestscCs8tjttjdddgd�}|�tt�|��dddh�dS)N�A�B�C)�file�pathr)r�create_packager�__file__rrrr)r
�packagerrr�test_resource_contents4s
z*ResourceLoaderTests.test_resource_contentscCs2tjttjdddddgd�}|�t�|d��dS)Nr"r#r$zD/EzD/F)r%r&r)rr'rr(r
rr)r
r)rrr�test_resource_is_resource;sz-ResourceLoaderTests.test_resource_is_resourcecCs2tjttjdddddgd�}|�t�|d��dS)Nr"r#r$zD/EzD/F)r%r&r�D)rr'rr(rrr)r
r)rrr�'test_resource_directory_is_not_resourceAsz;ResourceLoaderTests.test_resource_directory_is_not_resourcecCs2tjttjdddddgd�}|�t�|d��dS)Nr"r#r$zD/EzD/F)r%r&r�Z)rr'rr(rrr)r
r)rrr�%test_resource_missing_is_not_resourceGsz9ResourceLoaderTests.test_resource_missing_is_not_resourceN)rrrr*r+r-r/rrrrr!3sr!c@seZdZdd�ZdS)�ResourceCornerCaseTestscCsZtjttjdddgd�}t�|_d|_tjdkrD|j|j_	|j|j_
|�t�
|d��dS)Nr"r#r$)r%r&rz/path/which/shall/not/be/named)�)rr'rr(�object�
__loader__�sys�version_info�__spec__�loader�originrrr)r
�modulerrr�#test_package_has_no_reader_fallbackOs


z;ResourceCornerCaseTests.test_package_has_no_reader_fallbackN)rrrr:rrrrr0Nsr0c@seZdZeZdd�ZdS)�ResourceFromZipsTestcCs8|�tt�d��ddh�|�tt�d��ddh�dS)Nzziptestdata.onez__init__.pyz
resource1.txtzziptestdata.twoz
resource2.txt)rrrr)r
rrr�test_unrelated_contentscs
z,ResourceFromZipsTest.test_unrelated_contentsN)rrrr�
ZIP_MODULEr<rrrrr;`sr;c@s0eZdZeZdd�Zdd�Zdd�Zdd�Zd	S)
� SubdirectoryResourceFromZipsTestcCstd�}|�t�|d��dS)Nzziptestdata.subdirectoryzbinary.file)rr
rr)r
�	submodulerrr�test_is_submodule_resourcetsz;SubdirectoryResourceFromZipsTest.test_is_submodule_resourcecCs|�t�dd��dS)Nzziptestdata.subdirectoryzbinary.file)r
rr)r
rrr�$test_read_submodule_resource_by_nameyszESubdirectoryResourceFromZipsTest.test_read_submodule_resource_by_namecCs&td�}|�tt�|��ddh�dS)Nzziptestdata.subdirectoryz__init__.pyzbinary.file)rrrrr)r
r?rrr�test_submodule_contents}sz8SubdirectoryResourceFromZipsTest.test_submodule_contentscCs|�tt�d��ddh�dS)Nzziptestdata.subdirectoryz__init__.pyzbinary.file)rrrr)r
rrr�test_submodule_contents_by_name�sz@SubdirectoryResourceFromZipsTest.test_submodule_contents_by_nameN)	rrrrr=r@rArBrCrrrrr>qs
r>c@seZdZdd�ZdS)�
NamespaceTestcCsvt�d�}|�t|��|�t�dd��|�ttjdd�|�ttjdd�|�ttj	dd�|�ttj
dd�dS)Nz$test.test_importlib.data03.namespacez
resource1.txt)rrr�listrZassertRaises�FileNotFoundErrorZ	open_textZopen_binaryZ	read_textZread_binary)r
rrrr�%test_namespaces_cannot_have_resources�s*
z3NamespaceTest.test_namespaces_cannot_have_resourcesN)rrrrGrrrrrD�srD�__main__)r4Zunittest�rrrr�	importlibrrr	ZTestCaserZZipSetupr r!r0ZZipSetupBaser;r>rDr�mainrrrr�<module>s