Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_module.cpython-310.pyc
o

�9jx1�@s�ddlZddlZddlmZddlmZddlmZddlZee�Z	Gdd�d�Z
Gdd�d�ZGd	d
�d
ej�Z
edkrCe��dSdS)�N)�
gc_collect)�
import_helper)�assert_python_okc@seZdZedd��ZdS)�
FullLoadercCsd�|j�S)Nz<module '{}' (crafted)>)�format�__name__)�cls�m�r
�'/usr/lib/python3.10/test/test_module.py�module_reprszFullLoader.module_reprN)r�
__module__�__qualname__�classmethodrr
r
r
rrsrc@seZdZdS)�
BareLoaderN)rr
rr
r
r
rrsrc@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dES)F�ModuleTestscCslt�t�}|�|jdu�|�tt|�z|j}|�dt	|��Wn	t
y+Ynw|�|jtj�dS)Nz
__name__ = %s)
�
ModuleType�__new__�
assertTrue�__dict__�assertRaises�	TypeError�dirr�fail�repr�AttributeError�assertEqual�__doc__)�self�foo�sr
r
r�test_uninitializeds
�zModuleTests.test_uninitializedcCs t�t�}|�tdt|d�dS)Nz"module has no attribute 'not_here'�not_here)rr�assertRaisesRegexr�getattr�rrr
r
r�"test_uninitialized_missing_getattr"s

�z.ModuleTests.test_uninitialized_missing_getattrcCstd�}|�tdt|d�dS)Nrz(module 'foo' has no attribute 'not_here'r")rr#rr$r%r
r
r�test_missing_getattr*s
�z ModuleTests.test_missing_getattrc	Csltd�}|�|jd�|�|jd�|�|jd�|�|jd�|�|jd�|�|jdddddd��dS)Nr�rr�
__loader__�__package__�__spec__)	rrrr�assertIsr)r*r+rr%r
r
r�test_no_docstring2s�zModuleTests.test_no_docstringc	C�Dtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�foodocr(�rrrrrr%r
r
r�test_ascii_docstring>�
��z ModuleTests.test_ascii_docstringc	Cr.)Nr�	foodocሴr(r0r%r
r
r�test_unicode_docstringHr2z"ModuleTests.test_unicode_docstringc
Cs|tdd�}d|_|j}|�dd�|�|jd�|�|jd�|�|jd�|�|jddddddd��|�|j|u�dS)Nrr3�*r/)rr�barr)r*r+)rr6r�__init__rrrr)rr�dr
r
r�test_reinitRs
��zModuleTests.test_reinitcCs&dd�}t�|�|�jdd�dS)NcSstd�}d|_|S)Nr�)rr6)rr
r
r�fbsz+ModuleTests.test_dont_clear_dict.<locals>.fr6r:)rrr)rr;r
r
r�test_dont_clear_dict`sz ModuleTests.test_dont_clear_dictcCs<g}td�}||_d}t||j�~t�|�|dg�dS)Nrzwclass A:
    def __init__(self, l):
        self.l = l
    def __del__(self):
        self.l.append(1)
a = A(destroyed)�)r�	destroyed�execrrr)rr>r	r r
r
r�test_clear_dict_in_ref_cycleisz(ModuleTests.test_clear_dict_in_ref_cyclecCs:td�}t�|�}|�|�|�~t�|�|�d�dS�Nr)r�weakref�refr,r)rr	�wrr
r
r�test_weakrefxs
zModuleTests.test_weakrefcCs�ddlm}ddlm}|�|d�|�|jd�|�|jd�|�td��|jWd�n1s4wY|�|j	d�t
jd=dS)	Nr)�testz
There is testr=�z Deprecated, use whatever insteadzThere is whatever�test.good_getattr)�test.good_getattr�good_getattrrFr�x�yr#r�yolo�whatever�sys�modules)r�ggarFr
r
r�test_module_getattr�s��zModuleTests.test_module_getattrcCs�ddlm}ddlm}|�|jd�|�|jd�|�t��|jWd�n1s-wY|�t��|jWd�n1sEwYt	j
d=dt	j
vrYt	j
d=dSdS)Nr��bad_getattr2r=�test.bad_getattr�test.bad_getattr2)�test.bad_getattr�bad_getattrrFrTrrKrr�noperOrP�r�bgarTr
r
r�test_module_getattr_errors�s��
�z&ModuleTests.test_module_getattr_errorscCs,ddlm}|�t|�gd��tjd=dS)Nr)�a�b�crH)rIrJrrrOrP)rrQr
r
r�test_module_dir�szModuleTests.test_module_dircCs�ddlm}ddlm}|�t��t|�Wd�n1s wY|�t��t|�Wd�n1s9wYtjd=dtjvrMtjd=dSdS)NrrSrUrV)	rWrXrFrTrrrrOrPrZr
r
r�test_module_dir_errors�s
�
�
�z"ModuleTests.test_module_dir_errorscCs�ddlm}|�t��|jWd�n1swY|�t��|jWd�n1s1wYdtjvrAtjd=dSdS)Nr)�bad_getattr3ztest.bad_getattr3)rFrbrr�one�
delgetattrrOrP)rrbr
r
r�test_module_getattr_tricky�s��
�z&ModuleTests.test_module_getattr_trickycCs td�}|`|�t|�d�dS)Nrz<module '?'>)rrrr�rr	r
r
r�test_module_repr_minimal�sz$ModuleTests.test_module_repr_minimalcCstd�}|�t|�d�dS�Nrz<module 'foo'>)rrrrfr
r
r�test_module_repr_with_name�sz&ModuleTests.test_module_repr_with_namecCs"td�}d|_|�t|�d�dS�Nr�/tmp/foo.pyz!<module 'foo' from '/tmp/foo.py'>)r�__file__rrrfr
r
r�'test_module_repr_with_name_and_filename�sz3ModuleTests.test_module_repr_with_name_and_filenamecCs&td�}|`d|_|�t|�d�dS)Nrrkz<module '?' from '/tmp/foo.py'>)rrrlrrrfr
r
r�#test_module_repr_with_filename_only�sz/ModuleTests.test_module_repr_with_filename_onlycCs*td�}|jdusJ�|�t|�d�dSrh)rr)rrrfr
r
r�$test_module_repr_with_loader_as_None�sz0ModuleTests.test_module_repr_with_loader_as_NonecC�4td�}|`t|_tt�}|�t|�d�|��dS�Nrz<module '?' ({})>)rrrr)rrr�rr	�loader_reprr
r
r�-test_module_repr_with_bare_loader_but_no_name�s�z9ModuleTests.test_module_repr_with_bare_loader_but_no_namecCrprq)rrrr)rrrrrr
r
r�-test_module_repr_with_full_loader_but_no_name�s�z9ModuleTests.test_module_repr_with_full_loader_but_no_namecCs0td�}t|_tt�}|�t|�d�|��dS)Nrz<module 'foo' ({})>)rrr)rrr)rr	rr
r
r�!test_module_repr_with_bare_loader�s�z-ModuleTests.test_module_repr_with_bare_loadercCs"td�}t|_|�t|�d�dS)Nr�<module 'foo' (crafted)>)rrr)rrrfr
r
r�!test_module_repr_with_full_loader�s
�z-ModuleTests.test_module_repr_with_full_loadercC�(td�}t|_d|_|�t|�d�dSrj)rrr)rlrrrfr
r
r�.test_module_repr_with_bare_loader_and_filename��z:ModuleTests.test_module_repr_with_bare_loader_and_filenamecCry)Nrrkrw)rrr)rlrrrfr
r
r�.test_module_repr_with_full_loader_and_filename�r{z:ModuleTests.test_module_repr_with_full_loader_and_filenamecCs|�tt�d�dS)Nz<module 'sys' (built-in)>)rrrO)rr
r
r�test_module_repr_builtinsz$ModuleTests.test_module_repr_builtincCsZtt�}d}d}|�|dt|��|d�||��|�|t|�d�|d�||��dS)Nz<module 'unittest' from 'z
__init__.py'>z{!r} does not start with {!r}z{!r} does not end with {!r})r�unittestr�lenr)r�r�starts_with�	ends_withr
r
r�test_module_repr_sources
�
�z#ModuleTests.test_module_repr_sourcecCs:tdd�\}}}|�|�|��}|�t|�hd��dS)Nz-czfrom test import final_a>�x = a�x = b�	len = len�
final_a.x = a�
final_b.x = b�shutil.rmtree = rmtree)r�assertFalse�
splitlinesr�set)r�rc�out�err�linesr
r
r�$test_module_finalization_at_shutdown
s
z0ModuleTests.test_module_finalization_at_shutdowncs:Gdd�d��G�fdd�dt�}|�tt|d�d�dS)Nc@seZdZdd�ZdS)z;ModuleTests.test_descriptor_errors_propagate.<locals>.DescrcSst�)N)�RuntimeError)r�o�tr
r
r�__get__szCModuleTests.test_descriptor_errors_propagate.<locals>.Descr.__get__N)rr
rr�r
r
r
r�Descrsr�cseZdZ��ZdS)z7ModuleTests.test_descriptor_errors_propagate.<locals>.MN)rr
r�melonr
�r�r
r�Ms
r��mymodr�)rrr�r$)rr�r
r�r� test_descriptor_errors_propagatesz,ModuleTests.test_descriptor_errors_propagatecCsvtd�}td�D]0}|�d|jv�|j}|�d|jv�|�|j|�|�|jd|�|dr4|`q|jd=qdS)Nrr:�__annotations__rG)r�ranger�rr�rr�rr�ir8r
r
r�test_lazy_create_annotations"s
�z(ModuleTests.test_lazy_create_annotationscCs~td�}td�D]4}|�d|jv�dti}||_|�d|jv�|�|j|�|�|jd|�|dr8|`q|jd=qdS)Nrr:r�r]rG)rr�r�r�intr�rrr�r
r
r�test_setting_annotations2s
�z$ModuleTests.test_setting_annotationscCs�t�t�}|�t��
t|j�Wd�n1swY|�t��i|_Wd�n1s2wY|�t��
|`Wd�n1sIwYtd�}i|_|`|�t��|`Wd�dS1sjwYdSrA)rrrr�printr�rr%r
r
r�test_annotations_getset_raises@s 
���"�z*ModuleTests.test_annotations_getset_raisescCs2t�d�}|�d|jv�|`|�d|jv�dS)Nztest.ann_module4r�)r�import_fresh_modulerrr�r�)r�ann_module4r
r
r�&test_annotations_are_created_correctlyQs
z2ModuleTests.test_annotations_are_created_correctlyN)%rr
rr!r&r'r-r1r4r9r<r@rErRr\r`rarergrirmrnrortrurvrxrzr|r}r�r�r�r�r�r�r�r
r
r
rrsF


	

		
r�__main__)r~rB�test.supportrr�test.support.script_helperrrO�typerrr�TestCaserr�mainr
r
r
r�<module>sI�

Youez - 2016 - github.com/yon3zu
LinuXploit