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/__pycache__/test_modulefinder.cpython-37.opt-1.pyc
B

��g8$�@s�ddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
Z
e��Zeej
�ej�gZdddddgdgdgd	gZdddddd
gdgdgdgZdddd
dddgddggdgZdddddddd
ddg	ddggdgZdd
dddddddddddgggdgZdddddddddddd dd!g
ggd"gZdddgd#ggd$gZdddgggd%gZddgggd&gZd'd(�Zd)d*�ZGd+d,�d,ej�Zed-k�r�e��dS).�N)�supportza.module�a�sys�b�czb.somethingz�a/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from sys import *
Z
__future__aa/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from __future__ import absolute_import
                                from sys import *
za.bza.cZmymoduleZblahblahamymodule.py
a/__init__.py
                                import blahblah
                                from a import b
                                import c
a/module.py
                                import sys
                                from a import b as x
                                from a.c import sillyname
a/b.py
a/c.py
                                from a.module import x
                                import mymodule as sillyname
                                from sys import version_info
zb.xzb.yzb.zZgc�zajmymodule.py
a/__init__.py
a/module.py
                                from __future__ import absolute_import
                                import sys # sys
                                import blahblah # fails
                                import gc # gc
                                import b.x # b.x
                                from b import y # b.y
                                from b.z import * # b.z.*
a/gc.py
a/sys.py
                                import mymodule
a/b/__init__.py
a/b/x.py
a/b/y.py
a/b/z.py
b/__init__.py
                                import z
b/unused.py
b/x.py
b/y.py
b/z.py
za.b.yza.b.zza.b.cz
a.b.c.moduleCza.b.c.dza.b.c.eza.b.xa�mymodule.py
a/__init__.py
                                from .b import y, z # a.b.y, a.b.z
a/module.py
                                from __future__ import absolute_import # __future__
                                import gc # gc
a/gc.py
a/sys.py
a/b/__init__.py
                                from ..b import x # a.b.x
                                #from a.b.c import moduleC
                                from .c import moduleC # a.b.moduleC
a/b/x.py
a/b/y.py
a/b/z.py
a/b/g.py
a/b/c/__init__.py
                                from ..c import e # a.b.c.e
a/b/c/moduleC.py
                                from ..c import d # a.b.c.d
a/b/c/d.py
a/b/c/e.py
a/b/c/x.py
za.sysza.b.c.fz	a.anothera�mymodule.py
a/__init__.py
                                from . import sys # a.sys
a/another.py
a/module.py
                                from .b import y, z # a.b.y, a.b.z
a/gc.py
a/sys.py
a/b/__init__.py
                                from .c import moduleC # a.b.c.moduleC
                                from .c import d # a.b.c.d
a/b/x.py
a/b/y.py
a/b/z.py
a/b/c/__init__.py
                                from . import e # a.b.c.e
a/b/c/moduleC.py
                                #
                                from . import f   # a.b.c.f
                                from .. import x  # a.b.x
                                from ... import another # a.another
a/b/c/d.py
a/b/c/e.py
a/b/c/f.py
za.barz�a/__init__.py
                                def foo(): pass
a/module.py
                                from . import foo
                                from . import bar
zza/__init__.py
                                def foo(): pass
a/module.py
                                from . import *
�c
CsVtj�|�}yt�|�Wn0tk
rJ}z|jtjkr:�Wdd}~XYnXt|d�S)N�w)�os�path�dirname�makedirs�OSError�errnoZEEXIST�open)rr�e�r�2/usr/local/lib/python3.7/test/test_modulefinder.py�	open_file�srcCsxd}z`xZ|��D]N}|�d�s(|�d�r<|�|��d�q|rH|��ttj�t	|����}qWWd|rr|��XdS)N� �	�
)
�
splitlines�
startswith�write�strip�closerr
r�join�TEST_DIR)�sourceZofi�linerrr�create_package�sr!c@steZdZddgfdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�ModuleFinderTestFrc	Cs�|\}}}}}	t|	�zptjt||d�}
|
�|�|r>|
��tt|��}t|
j�}|�	||�|
�
�\}}
|�	||�|�	|
|�Wdt�t
�XdS)N)r�debug�
replace_paths)r!�modulefinderZModuleFinder�	TEST_PATHZimport_hook�report�sorted�set�modulesZassertEqualZany_missing_maybe�shutilZrmtreer)�self�infor'r#r$Zimport_thisr*�missingZ
maybe_missingrZmf�foundZbad�mayberrr�_do_test�s


zModuleFinderTest._do_testcCs|�t�dS)N)r1�package_test)r,rrr�test_packageszModuleFinderTest.test_packagecCs|�t�dS)N)r1�
maybe_test)r,rrr�
test_maybeszModuleFinderTest.test_maybecCs|�t�dS)N)r1�maybe_test_new)r,rrr�test_maybe_newszModuleFinderTest.test_maybe_newcCs|�t�dS)N)r1�absolute_import_test)r,rrr�test_absolute_importssz&ModuleFinderTest.test_absolute_importscCs|�t�dS)N)r1�relative_import_test)r,rrr�test_relative_imports"sz&ModuleFinderTest.test_relative_importscCs|�t�dS)N)r1�relative_import_test_2)r,rrr�test_relative_imports_2%sz(ModuleFinderTest.test_relative_imports_2cCs|�t�dS)N)r1�relative_import_test_3)r,rrr�test_relative_imports_3(sz(ModuleFinderTest.test_relative_imports_3cCs|�t�dS)N)r1�relative_import_test_4)r,rrr�test_relative_imports_4+sz(ModuleFinderTest.test_relative_imports_4c	Csrtj�td�}|tjjd}|tjjd}t|��}|�	d�WdQRXt
j||d�t�|�|�
t�dS)Nrrztesting_modulefinder = True
)�cfile)r
rrr�	importlib�	machinery�SOURCE_SUFFIXES�BYTECODE_SUFFIXESrr�
py_compile�compile�remover1�
bytecode_test)r,�	base_path�source_path�
bytecode_path�filerrr�
test_bytecode.s

zModuleFinderTest.test_bytecodec	Csntj�tdd�}tj�tdd�}t���}|jtd||fgd�WdQRX|��}d||f}|�	||�dS)Nrz	module.pyzspam.py�)r#r$zco_filename %r changed to %r)
r
rrrrZcaptured_stdoutr1r4�getvalueZassertIn)r,Zold_path�new_path�outputZexpectedrrr�test_replace_paths8s
z#ModuleFinderTest.test_replace_pathscCs,dddgggdttd��g}|�|�dS)NrrzVa.py
                                %r
                                import b
b.py
i)�list�ranger1)r,Zextended_opargs_testrrr�test_extended_opargsBs
z%ModuleFinderTest.test_extended_opargsN)�__name__�
__module__�__qualname__r1r3r5r7r9r;r=r?rArOrTrWrrrrr"�s

r"�__main__) r
rZimportlib.machineryrCrGr+ZunittestZtempfileZtestrr%Zmkdtemprrr�__file__r&r4r6r2r8r:r<r>r@rJrr!ZTestCaser"rX�mainrrrr�<module>s�	
Y