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

��gG"�@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
��dS)�)�abc)�utilzimportlib.machinery�N)�make_legacy_pycc@s�eZdZdd�Zdd�Zd!ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Ze�ejdkd�dd��Zdd �ZdS)"�FinderTestscCs2|jj|jjf|jj|jjfg}|jj|f|��S)N)�	machinery�SourceFileLoader�SOURCE_SUFFIXES�SourcelessFileLoader�BYTECODE_SUFFIXES�
FileFinder)�self�root�loader_details�r�B/usr/local/lib/python3.7/test/test_importlib/source/test_finder.py�
get_finder)s
zFinderTests.get_findercCs|�|�}|j||dd�S)NT)�loader_only)r�_find)r
r�module�finderrrr�import_0s
zFinderTests.import_N)�compile_�unlinkc	Cs�|dkr|h}tj|���}|r:x|D]}t�||�q$W|r�x\|D]T}t�||�yt||�WqDtk
r�}z|jtj	kr��Wdd}~XYqDXqDW|�
|d|�}|�t|d��|SQRXdS)Nz.root�load_module)
r�create_modules�
py_compile�compile�osrr�OSError�errno�ENOENTr�
assertTrue�hasattr)	r
ZtestZcreaterr�mapping�name�error�loaderrrr�run_test4s"

zFinderTests.run_testcCs2|�d�|jddhdhd�|jddhd�dS)NZ	top_level)rr)r)r()r
rrr�test_moduleQs


zFinderTests.test_modulecCs>|�ddh�|jddhdhdhd�|jddhdhd�dS)NZpkgzpkg.__init__)rr)r)r()r
rrr�test_package[s
zFinderTests.test_packagec	CsHt�dd��2}tj�|d�}|�|d�}|�t|d��WdQRXdS)Nzpkg.__init__zpkg.subr)rrr�path�dirnamerr"r#)r
r$�pkg_dirr'rrr�test_module_in_packageesz"FinderTests.test_module_in_packagec	CsLt�dd�}|�2}tj�|d�}|�|d�}|�t|d��WdQRXdS)Nzpkg.__init__zpkg.sub.__init__zpkg.subr)rrrr+r,rr"r#)r
�contextr$r-r'rrr�test_package_in_packagels
z#FinderTests.test_package_in_packagecCs0d}|�|d�|�|h�}|�d|�|��dS)NZ_tempz{0}.__init__�__init__)r(�formatZassertIn�get_filename)r
r%r'rrr�test_package_over_moduletsz$FinderTests.test_package_over_modulec	Cs4t�d�� }|�|dd�}|�|�WdQRXdS)NZblahz.rootZ
sdfsadsadf)rrr�assertIsNone)r
r$Znothingrrr�test_failureyszFinderTests.test_failurec	Csp|j�d|jj|jjf�}tdd��}|�d�WdQRXz$|j|ddd�}|�t|d��Wdt	�
d�XdS)	N�zmod.py�wz# test file for importlib�modT)rr)rrrr	�open�writerr"r#rr)r
r�filer'rrr�test_empty_string_for_dir~sz%FinderTests.test_empty_string_for_dircCs:|j�d|jj|jjf�}d|_|��|�|jd�dS)Nr7�*���)rrrr	�_path_mtime�invalidate_caches�assertEqual)r
rrrr�test_invalidate_caches�s
z"FinderTests.test_invalidate_cachesc	Cs`d}t�|��.}|�|d�}|j|ddd�}|�|�WdQRX|j|ddd�}|�|�dS)Nr9z.rootT)r)rrrrZassertIsNotNoner5)r
r9r$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�dS)N)r�chmodr%�__exit__)�tempdir)�
original_moderr�cleanup�sz3FinderTests.test_no_read_directory.<locals>.cleanup�doesnotexist)�tempfileZTemporaryDirectoryr�statr%�st_modeZ
addCleanuprG�S_IWUSR�S_IXUSRrrrB�	NOT_FOUND)r
rIrKrrDr)rJr�test_no_read_directory�s
z"FinderTests.test_no_read_directoryc	Cs>t���,}|�|j�}|�|d�}|�||j�WdQRXdS)NrL)rMZNamedTemporaryFilerr%rrBrR)r
Zfile_objrrDrrr�test_ignore_file�s
zFinderTests.test_ignore_file)N)�__name__�
__module__�__qualname__rrr(r)r*r.r0r4r6r=rCrE�unittestZ
skipUnless�sys�platformrSrTrrrrrs

		rc@seZdZdZddd�ZdS)�FinderTestsPEP451NFcCs|�|�}|dk	r|jS|S)N)�	find_specr')r
rr%r�specrrrr�s
zFinderTestsPEP451._find)F)rUrVrWrRrrrrrr[�sr[)rc@seZdZdgfZddd�ZdS)�FinderTestsPEP420NFc	Cs:t���(t�dt�|�|�}|r,|dS|SQRXdS)N�ignorer)�warnings�catch_warnings�simplefilter�DeprecationWarning�find_loader)r
rr%rZloader_portionsrrrr�s

zFinderTestsPEP420._find)F)rUrVrWrRrrrrrr^�sr^c@seZdZdZddd�ZdS)�FinderTestsPEP302NFc	Cs*t���t�dt�|�|�SQRXdS)Nr_)r`rarbrc�find_module)r
rr%rrrrr�s
zFinderTestsPEP302._find)F)rUrVrWrRrrrrrre�sre�__main__)r7rrZimport_importlibrr rrrNrYrMZtest.supportrrXr`rr[Z	test_bothZFrozen_FinderTestsPEP451ZSource_FinderTestsPEP451r^ZFrozen_FinderTestsPEP420ZSource_FinderTestsPEP420reZFrozen_FinderTestsPEP302ZSource_FinderTestsPEP302rU�mainrrrr�<module>s*
.