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/builtin/__pycache__/test_loader.cpython-310.pyc
o

�i�@s�ddlmZddlmZe�d�ZddlZddlZddlZddlZe�	ej
jdud�Gdd�dej��Zej
eed	�\ZZe�	ej
jdud�Gd
d�d��Zej
eed	�\ZZedkrae��dSdS)
�)�abc)�utilzimportlib.machinery�Nzno reasonable builtin modulec@sTeZdZdZdd�Zdd�Zdd�Zdd	�Zd
ZZ	d
Z
dd�Zd
d�Zdd�Z
d
S)�LoaderTestsz(Test load_module() for built-in modules.cCsdd|jjd�|_dS)N�errno�)�__name__�__package__�
__loader__)�	machinery�BuiltinImporter�verification)�self�r�D/usr/local/lib/python3.10/test/test_importlib/builtin/test_loader.py�setUps�zLoaderTests.setUpcCsH|�|tj�|j��D]
\}}|�t||�|�q|�|jt	j
�dS)z;Verify that the module matches against what it should have.N)ZassertIsInstance�types�
ModuleTyper
�items�assertEqual�getattrZassertInr�sys�modules)r�module�attr�valuerrr�verifyszLoaderTests.verifycCsFt���t�dt�|jj�|�Wd�S1swYdS)N�ignore)�warnings�catch_warnings�simplefilter�DeprecationWarningrr�load_module)r�namerrrr"s
$�zLoaderTests.load_modulecCsLt�tjj��|�tjj�}|�|�Wd�dS1swYdS�N)r�uncache�BUILTINS�	good_namer"r)rrrrr�test_module s"�zLoaderTests.test_moduleNcCs\t�tjj��|�tjj�}|�tjj�}|�||�Wd�dS1s'wYdSr$)rr%r&r'r"ZassertIs)rZmodule1Zmodule2rrr�test_module_reuse,s
"�zLoaderTests.test_module_reusecCsZd}|tjvs	J�|�t��
}|�|�Wd�n1swY|�|jj|�dS)NZ	dssdsdfff)r�builtin_module_names�assertRaises�ImportErrorr"r�	exceptionr#)rr#�cmrrr�test_unloadable3s�zLoaderTests.test_unloadablecCs�d}|tjvs	J�t�|��t�|�}|tj|<Wd�n1s#wY|�t��
}|�	|�Wd�n1s=wY|�
|jj|�dS)NZbuiltin_reload_test)
rr*rr%rrrr+r,r"rr-r#)r�module_namerr.rrr�test_already_imported:s
��z!LoaderTests.test_already_imported)r�
__module__�__qualname__�__doc__rrr"r(Ztest_packageZtest_lacking_parentZtest_state_after_failurer)r/r1rrrrrsr)rc@sDeZdZdZdd�Zdd�Zdd�Ze�e	j
jdud	�d
d��ZdS)�InspectLoaderTestsz4Tests for InspectLoader methods for BuiltinImporter.cC� |jj�tjj�}|�|�dSr$)rr�get_coderr&r'�assertIsNone�r�resultrrr�
test_get_codeQ�z InspectLoaderTests.test_get_codecCr6r$)rr�
get_sourcerr&r'r8r9rrr�test_get_sourceVr<z"InspectLoaderTests.test_get_sourcecCr6r$)rr�
is_packagerr&r'ZassertFalser9rrr�test_is_package[r<z"InspectLoaderTests.test_is_packageNzall modules are built incCsTdD]	}t|jj|�}q|�t��}|tjj�Wd�dS1s#wYdS)N)r7r=r?)rrrr+r,rr&�bad_name)rZ	meth_name�methodr.rrr�test_not_builtin`s
"�z#InspectLoaderTests.test_not_builtin)
rr2r3r4r;r>r@�unittest�skipIfrr&rArCrrrrr5Lsr5�__main__)rrrZimport_importlibrrrrDrrEr&r'rZ	test_bothZFrozen_LoaderTestsZSource_LoaderTestsr5ZFrozen_InspectLoaderTestsZSource_InspectLoaderTestsr�mainrrrr�<module>s(
=���