Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_module.cpython-39.pyc

a

��g�(�@szddlZddlZddlmZddlmZddlZee�ZGdd�d�Z	Gdd�d�Z
Gdd	�d	ej�Ze
d
krve��dS)�N)�
gc_collect)�assert_python_okc@seZdZedd��ZdS)�
FullLoadercCsd�|j�S)Nz<module '{}' (crafted)>)�format�__name__)�cls�m�r	�,/usr/local/lib/python3.9/test/test_module.py�module_reprszFullLoader.module_reprN)r�
__module__�__qualname__�classmethodrr	r	r	r
r
src@seZdZdS)�
BareLoaderN)rrr
r	r	r	r
rsrc@s�eZdZdd�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=S)>�ModuleTestscCslt�t�}|�|jdu�|�tt|�z|j}|�dt	|��Wnt
yVYn0|�|jtj�dS)Nz
__name__ = %s)
�
ModuleType�__new__�
assertTrue�__dict__�assertRaises�SystemError�dirrZfail�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_docstring1s�zModuleTests.test_no_docstringc	CsDtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�foodocr&�rrrrrr#r	r	r
�test_ascii_docstring=s
��z ModuleTests.test_ascii_docstringc	CsDtdd�}|�|jd�|�|jd�|�|jdddddd��dS)Nr�	foodocሴr&r-r#r	r	r
�test_unicode_docstringGs
��z"ModuleTests.test_unicode_docstringc
Cs|tdd�}d|_|j}|�dd�|�|jd�|�|jd�|�|jd�|�|jddddddd��|�|j|u�dS)Nrr/�*r,)rr�barr'r(r))rr2r�__init__rrrr)rr�dr	r	r
�test_reinitQs
��zModuleTests.test_reinitcCs&dd�}t�|�|�jdd�dS)NcSstd�}d|_|S)Nr�)rr2)rr	r	r
�fasz+ModuleTests.test_dont_clear_dict.<locals>.fr2r6)rrr)rr7r	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:rrr	r	r
�test_clear_dict_in_ref_cyclehsz(ModuleTests.test_clear_dict_in_ref_cyclecCs:td�}t�|�}|�|�|�~t�|�|�d�dS)Nr)r�weakref�refr*r)rr�wrr	r	r
�test_weakrefws
zModuleTests.test_weakrefcCs�ddlm}ddlm}|�|d�|�|jd�|�|jd�|�td��|jWd�n1sh0Y|�|j	d�t
jd=dS)	Nr)�testz
There is testr9�z Deprecated, use whatever insteadzThere is whatever�test.good_getattr)�test.good_getattr�good_getattrrAr�x�yr!rZyoloZwhatever�sys�modules)r�ggarAr	r	r
�test_module_getattrs�$zModuleTests.test_module_getattrcCs�ddlm}ddlm}|�|jd�|�|jd�|�t��|jWd�n1sZ0Y|�t��|jWd�n1s�0Yt	j
d=dt	j
vr�t	j
d=dS)Nr��bad_getattr2r9�test.bad_getattr�test.bad_getattr2)�test.bad_getattr�bad_getattrrArMrrFr�	TypeErrorZnoperHrI�rZbgarMr	r	r
�test_module_getattr_errors�s$$
z&ModuleTests.test_module_getattr_errorscCs,ddlm}|�t|�gd��tjd=dS)Nr)�a�b�crC)rDrErrrHrI)rrJr	r	r
�test_module_dir�szModuleTests.test_module_dircCs�ddlm}ddlm}|�t��t|�Wd�n1s@0Y|�t��t|�Wd�n1sr0Ytjd=dtjvr�tjd=dS)NrrLrNrO)	rPrQrArMrrRrrHrIrSr	r	r
�test_module_dir_errors�s&&
z"ModuleTests.test_module_dir_errorscCs�ddlm}|�t��|jWd�n1s20Y|�t��|jWd�n1sb0Ydtjvr~tjd=dS)Nr)�bad_getattr3ztest.bad_getattr3)rArZrrZoneZ
delgetattrrHrI)rrZr	r	r
�test_module_getattr_tricky�s$$
z&ModuleTests.test_module_getattr_trickycCs td�}|`|�t|�d�dS)Nrz<module '?'>)rrrr�rrr	r	r
�test_module_repr_minimal�sz$ModuleTests.test_module_repr_minimalcCstd�}|�t|�d�dS�Nrz<module 'foo'>)rrrr\r	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__rrr\r	r	r
�'test_module_repr_with_name_and_filename�sz3ModuleTests.test_module_repr_with_name_and_filenamecCs&td�}|`d|_|�t|�d�dS)Nrraz<module '?' from '/tmp/foo.py'>)rrrbrrr\r	r	r
�#test_module_repr_with_filename_only�sz/ModuleTests.test_module_repr_with_filename_onlycCs*td�}|jdusJ�|�t|�d�dSr^)rr'rrr\r	r	r
�$test_module_repr_with_loader_as_None�sz0ModuleTests.test_module_repr_with_loader_as_NonecCs4td�}|`t|_tt�}|�t|�d�|��dS�Nrz<module '?' ({})>)rrrr'rrr�rrZloader_reprr	r	r
�-test_module_repr_with_bare_loader_but_no_name�s�z9ModuleTests.test_module_repr_with_bare_loader_but_no_namecCs4td�}|`t|_tt�}|�t|�d�|��dSrf)rrrr'rrrrgr	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)rrrr	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'rrr\r	r	r
�!test_module_repr_with_full_loader�s
�z-ModuleTests.test_module_repr_with_full_loadercCs(td�}t|_d|_|�t|�d�dSr`)rrr'rbrrr\r	r	r
�.test_module_repr_with_bare_loader_and_filename�sz:ModuleTests.test_module_repr_with_bare_loader_and_filenamecCs(td�}t|_d|_|�t|�d�dS)Nrrark)rrr'rbrrr\r	r	r
�.test_module_repr_with_full_loader_and_filename�sz:ModuleTests.test_module_repr_with_full_loader_and_filenamecCs|�tt�d�dS)Nz<module 'sys' (built-in)>)rrrH)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�rZstarts_withZ	ends_withr	r	r
�test_module_repr_sources
�
�z#ModuleTests.test_module_repr_sourcecCs:tdd�\}}}|�|�|��}|�t|�hd��dS)Nz-czfrom test import final_a>s
final_a.x = asx = bsshutil.rmtree = rmtreesx = as	len = lens
final_b.x = b)rZassertFalse�
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�dS)N)�RuntimeError)r�o�tr	r	r
�__get__szCModuleTests.test_descriptor_errors_propagate.<locals>.Descr.__get__N)rrr
r~r	r	r	r
�DescrsrcseZdZ��ZdS)z7ModuleTests.test_descriptor_errors_propagate.<locals>.MN)rrr
�melonr	�rr	r
�Msr�Zmymodr�)rrr{r")rr�r	r�r
� test_descriptor_errors_propagatesz,ModuleTests.test_descriptor_errors_propagateN)!rrr
rr$r%r+r.r0r5r8r<r@rKrTrXrYr[r]r_rcrdrerhrirjrlrmrnrorsrzr�r	r	r	r
rs<


	

		
r�__main__)rpr=Ztest.supportrZtest.support.script_helperrrH�typerrrZTestCaserr�mainr	r	r	r
�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists