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/source/__pycache__/test_finder.cpython-310.opt-2.pyc
o

�ig"�@s�ddlmZddlmZe�d�ZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
Z
ddlZGdd�dej�ZGd	d
�d
e�Zejeed�\ZZGdd
�d
e�Zejeed�\ZZGdd�de�Zejeed�\ZZedkr}e
��dSdS)�)�abc)�utilzimportlib.machinery�N)�make_legacy_pycc@s�eZdZ	dd�Zdd�Zd!ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Ze�ejdkd�dd��Zdd �ZdS)"�FinderTestscCs4|jj|jjf|jj|jjfg}|jj|g|�R�S�N)�	machinery�SourceFileLoader�SOURCE_SUFFIXES�SourcelessFileLoader�BYTECODE_SUFFIXES�
FileFinder)�self�root�loader_details�r�C/usr/local/lib/python3.10/test/test_importlib/source/test_finder.py�
get_finder)s���zFinderTests.get_findercCs|�|�}|j||dd�S)NT��loader_only)r�_find)rr�module�finderrrr�import_0s
zFinderTests.import_N��compile_�unlinkc	Cs�	|dur|h}tj|��W}|r|D]	}t�||�q|rK|D]*}t�||�zt||�Wq tyJ}z
|jtj	kr@�WYd}~q d}~ww|�
|d|�}|�t|d��|Wd�S1sgwYdS)N�.root�load_module)
r�create_modules�
py_compile�compile�osrr�OSError�errno�ENOENTr�
assertTrue�hasattr)	r�testZcreaterr�mapping�name�error�loaderrrr�run_test4s,���$�zFinderTests.run_testcCs2|�d�|jddhdhd�|jddhd�dS)NZ	top_levelr�r�r-�rrrr�test_moduleQs


�zFinderTests.test_modulecCs>|�ddh�|jddhdhdhd�|jddhdhd�dS)NZpkg�pkg.__init__rr.r/r0rrr�test_package[s
�zFinderTests.test_packagecCs^t�dd��}tj�|d�}|�|d�}|�t|d��Wd�dS1s(wYdS)Nr2�pkg.subr�rrr"�path�dirnamerr&r')rr)�pkg_dirr,rrr�test_module_in_packagees
"�z"FinderTests.test_module_in_packagecCsbt�dd�}|�}tj�|d�}|�|d�}|�t|d��Wd�dS1s*wYdS)Nr2zpkg.sub.__init__r4rr5)r�contextr)r8r,rrr�test_package_in_packagels"�z#FinderTests.test_package_in_packagecCs0d}|�|d�|�|h�}|�d|�|��dS)NZ_tempz{0}.__init__�__init__)r-�formatZassertIn�get_filename)rr*r,rrr�test_package_over_moduletsz$FinderTests.test_package_over_modulecCsJt�d��}|�|dd�}|�|�Wd�dS1swYdS)NZblahrZ
sdfsadsadf)rrr�assertIsNone)rr)Znothingrrr�test_failureys"�zFinderTests.test_failurec	Cs�|j�d|jj|jjf�}tdddd��
}|�d�Wd�n1s$wYz|j|ddd	�}|�t|d
��Wt	�
d�dSt	�
d�w)N�zmod.py�wzutf-8)�encodingz# test file for importlib�modTrr)rr
r	r
�open�writerr&r'r"r)rr�filer,rrr�test_empty_string_for_dir~s��z%FinderTests.test_empty_string_for_dircCs:|j�d|jj|jjf�}d|_|��|�|jd�dS)NrB�*���)rr
r	r
�_path_mtime�invalidate_caches�assertEqual)rrrrr�test_invalidate_caches�s�z"FinderTests.test_invalidate_cachescCstd}t�|��}|�|d�}|j|ddd�}|�|�Wd�n1s&wY|j|ddd�}|�|�dS)NrErTr)rrrrZassertIsNotNoner@)rrEr)r�foundrrr�test_dir_removal_handling�s�z%FinderTests.test_dir_removal_handling�win32z>os.chmod() does not support the needed arguments under Windowscsnt��}t�|j�j��fdd�}|�||�t�|jtjtj	B�|�
|j�}|�|d�}|�||j
�dS)Ncs"	t�|j��|�ddd�dSr)r"�chmodr*�__exit__)�tempdir�Z
original_moderr�cleanup�sz3FinderTests.test_no_read_directory.<locals>.cleanup�doesnotexist)�tempfile�TemporaryDirectoryr"�statr*�st_modeZ
addCleanuprS�S_IWUSR�S_IXUSRrrrN�	NOT_FOUND)rrUrWrrPrrVr�test_no_read_directory�s
z"FinderTests.test_no_read_directorycCsTt���}|�|j�}|�|d�}|�||j�Wd�dS1s#wYdS)NrX)rY�NamedTemporaryFilerr*rrNr_)rZfile_objrrPrrr�test_ignore_file�s

"�zFinderTests.test_ignore_filer)�__name__�
__module__�__qualname__rrr-r1r3r9r;r?rArIrOrQ�unittestZ
skipUnless�sys�platformr`rbrrrrrs&

		�
rc@�eZdZdZddd�ZdS)�FinderTestsPEP451NFcCs|�|�}|dur|jS|Sr)�	find_specr,)rrr*r�specrrrr�s
zFinderTestsPEP451._find�F�rcrdrer_rrrrrrj��rj)rc@seZdZdgfZddd�ZdS)�FinderTestsPEP420NFcCsRt���t�dt�|�|�}|r|dn|Wd�S1s"wYdS)N�ignorer)�warnings�catch_warnings�simplefilter�DeprecationWarning�find_loader)rrr*rZloader_portionsrrrr�s


$�zFinderTestsPEP420._findrmrnrrrrrp�srpc@ri)�FinderTestsPEP302NFcCsBt���t�dt�|�|�Wd�S1swYdS)Nrq)rrrsrtru�find_module)rrr*rrrrr�s
$�zFinderTestsPEP302._findrmrnrrrrrw�rorw�__main__)rBrrZimport_importlibrr$r"r r[rgrYZtest.support.import_helperrrfrrrrjZ	test_bothZFrozen_FinderTestsPEP451ZSource_FinderTestsPEP451rpZFrozen_FinderTestsPEP420ZSource_FinderTestsPEP420rwZFrozen_FinderTestsPEP302ZSource_FinderTestsPEP302rc�mainrrrr�<module>s:
.�
���