403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.17
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/test_importlib/frozen/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/test_importlib/frozen/__pycache__/test_loader.cpython-36.pyc
3

�w2_{$�@s�ddlmZddlmZejd�ZddlmZddlZddlZddl	Z	Gdd�dej
�Zejeed	�\Z
ZGd
d�dej
�Z
eje
ed	�\ZZGdd
�d
�Zejeed	�\ZZedkr�ej�dS)�)�abc)�utilzimportlib.machinery�)�captured_stdoutNc@sHeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
Z	dd�Z
d
S)�ExecModuleTestscCs�tj|���t���}|jj||jjd|jjj|�d�}tj|�}||_	t
|d�sVt�|jjj|�|j
|j�|j
t
|d��|j|j	jd�||j�fSQRXWdQRXdS)N�frozen)�origin�
is_package�initialized�__spec__)r�uncacher�	machinery�
ModuleSpec�FrozenImporterr	�types�
ModuleTyper�hasattr�AssertionError�exec_module�
assertTruer
�assertEqualr�getvalue)�self�name�stdout�spec�module�r�K/opt/alt/python36/lib64/python3.6/test/test_importlib/frozen/test_loader.pyrs

zExecModuleTests.exec_modulecCsbd}|j|�\}}d|i}x&|j�D]\}}|jt||�|�q$W|j|d�|jt|d��dS)N�	__hello__�__name__z
Hello world!
r)r�itemsr�getattrrr)rrr�output�check�attr�valuerrr�test_moduleszExecModuleTests.test_modulec
Csfd}|j|�\}}d|i}x:|j�D].\}}t||�}|j||dj||||d��q$W|j|d�dS)N�
__phello__r z,for {name}.{attr}, {given!r} != {expected!r})rr%�given�expectedz
Hello world!
)rr!r"r�format)rrrr#r$r%r&�
attr_valuerrr�test_package%s
zExecModuleTests.test_packagecCs|d}tjd��d|j|�\}}d|i}x:|j�D].\}}t||�}|j||dj||||d��q0W|j|d�WdQRXdS)Nz__phello__.spamr(r z*for {name}.{attr}, {given} != {expected!r})rr%r)r*z
Hello world!
)rrrr!r"rr+)rrrr#r$r%r&r,rrr�test_lacking_parent1s
z#ExecModuleTests.test_lacking_parentc
CsPd}|j|�\}}tj�� tjdt�|jjj|�}WdQRX|j|d�dS)Nr�ignorez<module '__hello__' (frozen)>)	r�warnings�catch_warnings�simplefilter�DeprecationWarningr
r�module_reprr)rrrr#�repr_strrrr�test_module_repr>s
z ExecModuleTests.test_module_reprcCs&d}|j|�\}}|jt|�d�dS)Nrz<module '__hello__' (frozen)>)rr�repr)rrrr#rrr�test_module_repr_indirectGs
z)ExecModuleTests.test_module_repr_indirectNc
CsJ|jjjd�dkst�|jt��}|jd�WdQRX|j|jj	d�dS)N�	_not_real)
r
r�find_moduler�assertRaises�ImportErrorrr�	exceptionr)r�cmrrr�test_unloadablePszExecModuleTests.test_unloadable)r �
__module__�__qualname__rr'r-r.r6r8�test_state_after_failurer?rrrrrs	
	r)r
c@sHeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
Z	dd�Z
d
S)�LoaderTestscCs�tjd���t���}tj�� tjdt�|jjj	d�}WdQRXdd|jjd�}x&|j
�D]\}}|jt||�|�q\W|j|j
�d�|jt|d��WdQRXWdQRXdS)Nrr/�)r �__package__�
__loader__z
Hello world!
�__file__)rrrr0r1r2r3r
r�load_moduler!rr"r�assertFalser)rrrr$r%r&rrrr'^s
zLoaderTests.test_modulecCs�tjd���t���}tj�� tjdt�|jjj	d�}WdQRXddg|jjd�}x6|j
�D]*\}}t||�}|j||d|||f�q^W|j|j
�d�|jt|d��WdQRXWdQRXdS)Nr(r/)r rE�__path__rFzfor __phello__.%s, %r != %rz
Hello world!
rG)rrrr0r1r2r3r
rrHr!r"rrrIr)rrrr$r%r&r,rrrr-ls

zLoaderTests.test_packagecCs�tjdd���t���}tj�� tjdt�|jjj	d�}WdQRXdd|jjd�}x6|j
�D]*\}}t||�}|j||d|||f�q^W|j|j
�d�|jt|d��WdQRXWdQRXdS)Nr(z__phello__.spamr/)r rErFz for __phello__.spam.%s, %r != %rz
Hello world!
rG)rrrr0r1r2r3r
rrHr!r"rrrIr)rrrr$r%r&r,rrrr.~s

zLoaderTests.test_lacking_parentcCs�tjd��pt��^}tj��.tjdt�|jjj	d�}|jjj	d�}WdQRX|j
||�|j|j�d�WdQRXWdQRXdS)Nrr/zHello world!
Hello world!
)
rrrr0r1r2r3r
rrHZassertIsrr)rrZmodule1Zmodule2rrr�test_module_reuse�s

zLoaderTests.test_module_reusecCsttjd��`t��Ntj��.tjdt�|jjj	d�}|jjj
|�}WdQRX|j|d�WdQRXWdQRXdS)Nrr/z<module '__hello__' (frozen)>)rrrr0r1r2r3r
rrHr4r)rrr5rrrr6�s
zLoaderTests.test_module_reprcCsJtjd��&t��|jjjd�}WdQRXWdQRX|jt|�d�dS)Nrz<module '__hello__' (frozen)>)rrrr
rrHrr7)rrrrrr8�s"
z%LoaderTests.test_module_repr_indirectNc
CsN|jjjd�dkst�|jt��}|jjjd�WdQRX|j|jj	d�dS)Nr9)
r
rr:rr;r<rHrr=r)rr>rrrr?�szLoaderTests.test_unloadable)r r@rAr'r-r.rKr6r8rBr?rrrrrC\s
	rCc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�InspectLoaderTestsz7Tests for the InspectLoader methods for FrozenImporter.cCs^d}t��J}|jjj|�}tj|�}t||j�|jt	|d��|j
|j�d�WdQRXdS)Nrr
z
Hello world!
)rr
r�get_coderr�exec�__dict__rrrr)rrr�code�modrrr�
test_get_code�s
z InspectLoaderTests.test_get_codecCs|jjjd�}|j|�dS)Nr)r
r�
get_sourceZassertIsNone)r�resultrrr�test_get_source�sz"InspectLoaderTests.test_get_sourcecCs8d	}x.|D]&\}}|jjj|�}|jt|�|�q
WdS)
NrFr(T�__phello__.spam�rF�r(T�rVF)rWrXrY)r
rr	r�bool)rZtest_forrr	rTrrr�test_is_package�s
z"InspectLoaderTests.test_is_packagecCsNxHdD]@}t|jj|�}|jt��}|d�WdQRX|j|jjd�qWdS)NrMrSr	�	importlib)rMrSr	)r"r
rr;r<rr=r)rZ	meth_name�methodr>rrr�test_failure�s

zInspectLoaderTests.test_failureN)r r@rA�__doc__rRrUr[r^rrrrrL�s

rL�__main__)rDrrZimport_importlibr
Ztest.supportrrZunittestr0rCrZ	test_bothZFrozen_ExecModuleTestsZSource_ExecModuleTestsZFrozen_LoaderTestsZSource_LoaderTestsrLZFrozen_ILTestsZSource_ILTestsr �mainrrrr�<module>s
MY%

Youez - 2016 - github.com/yon3zu
LinuXploit