Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_module/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_module/__pycache__/__init__.cpython-312.pyc

�

)Μg�8����ddlZddlZddlZddlmZddlmZddlmZddl	Z	e
e	�ZGd�d�ZGd�d�Z
Gd	�d
ej�Zedk(rej"�yy)�N)�
gc_collect)�
import_helper)�assert_python_okc��eZdZy)�
FullLoaderN��__name__�
__module__�__qualname__���6/usr/local/lib/python3.12/test/test_module/__init__.pyrr
���r
rc��eZdZy)�
BareLoaderNrrr
rrrrr
rc��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)y())�ModuleTestsc��tjt�}|jt|jt
��|j
t|�g�	|j}|jdt|�z�|j
|jtjxsd�y#t$rY�:wxYw)Nz
__name__ = %s�)
�
ModuleType�__new__�
assertTrue�
isinstance�__dict__�dict�assertEqual�dirr	�fail�repr�AttributeError�__doc__)�self�foo�ss   r�test_uninitializedzModuleTests.test_uninitializeds���� � ��,�����
�3�<�<��6�7�����S��2�&�	����A��I�I�o��Q��/�0�	
������j�&8�&8�&>�B�?���	��	�s�)B7�7	C�Cc�p�tjt�}|jtdt|d�y)Nz"module has no attribute 'not_here'�not_here)rr�assertRaisesRegexr �getattr�r"r#s  r�"test_uninitialized_missing_getattrz.ModuleTests.test_uninitialized_missing_getattr#s/��� � ��,������ D���j�	*r
c�T�td�}|jtdt|d�y)Nr#z(module 'foo' has no attribute 'not_here'r')rr(r r)r*s  r�test_missing_getattrz ModuleTests.test_missing_getattr+s)���������� J���j�	*r
c	�v�td�}|j|jd�|j|jd�|j	|j
d�|j	|jd�|j	|jd�|j|jdddddd��y)Nr#�r	r!�
__loader__�__package__�__spec__)	rrr	r!�assertIsr0r1r2rr*s  r�test_no_docstringzModuleTests.test_no_docstring3s�������������u�-�������d�+��
�
�c�n�n�d�+��
�
�c�o�o�t�,��
�
�c�l�l�D�)�������E�d�6:�4�48�(:�	;r
c	���tdd�}|j|jd�|j|jd�|j|jdddddd��y)Nr#�foodocr/�rrr	r!rr*s  r�test_ascii_docstringz ModuleTests.test_ascii_docstring?s\�����)��������u�-�������h�/�������&+��(,�T�&*�,�	-r
c	���tdd�}|j|jd�|j|jd�|j|jdddddd��y)Nr#�	foodocሴr/r7r*s  r�test_unicode_docstringz"ModuleTests.test_unicode_docstringIs\�����/��������u�-�������n�5�������&+��(,�T�&*�,�	-r
c
��tdd�}d|_|j}|jdd�|j	|j
d�|j	|jd�|j	|jd�|j	|jddddddd��|j|j|u�y)Nr#r:�*r6)r	r!�barr0r1r2)rr>r�__init__rr	r!r)r"r#�ds   r�test_reinitzModuleTests.test_reinitSs������/������L�L�����U�H�%�������u�-�������h�/�������"�%������� �X�b�!�$�D�J�	K�	
�������)�*r
c�f�d�}t�|j|�jdd�y)Nc�*�td�}d|_|S)Nr#�)rr>)r#s r�fz+ModuleTests.test_dont_clear_dict.<locals>.fcs���U�#�C��C�G��Jr
r>rD)rrr)r"rEs  r�test_dont_clear_dictz ModuleTests.test_dont_clear_dictas)��	�	���������e�,�a�0r
c��g}td�}||_d}t||j�~t	�|j|dg�y)Nr#zwclass A:
    def __init__(self, l):
        self.l = l
    def __del__(self):
        self.l.append(1)
a = A(destroyed)�)r�	destroyed�execrrr)r"rI�mr$s    r�test_clear_dict_in_ref_cyclez(ModuleTests.test_clear_dict_in_ref_cyclejsI���	��u������
��	
�Q��
�
��
�������Q�C�(r
c��td�}tj|�}|j|�|�~t	�|j|�d�y�Nr#)r�weakref�refr3r)r"rK�wrs   r�test_weakrefzModuleTests.test_weakrefysA���u���
�[�[��^���
�
�b�d�A��
����
�
�b�d�D�!r
c�~�ddlmcm}ddlm}|j	|d�|j	|j
d�|j	|jd�|jtd�5|jddd�|j	|jd�tjd=y#1swY�7xYw)	Nr)�testz
There is testrH�z Deprecated, use whatever insteadzThere is whatever�test.test_module.good_getattr)
�test.test_module.good_getattr�test_module�good_getattrrTr�x�yr(r �yolo�whatever�sys�modules)r"�ggarTs   r�test_module_getattrzModuleTests.test_module_getattr�s���3�3�6������/��������"��������"�
�
#�
#�N�$F�H��H�H�H�	
������':�;��K�K�7�8�	H�H�s�0
B3�3B<c���ddlmcm}ddlm}|j|jd�|j|jd�|jt�5|jddd�|jt�5|jddd�tjd=dtjvrtjd=yy#1swY�ixYw#1swY�KxYw)Nr��bad_getattr2rH�test.test_module.bad_getattr�test.test_module.bad_getattr2)�test.test_module.bad_getattrrX�bad_getattr�test.test_modulerdrrZ�assertRaises�	TypeError�noper^r_�r"�bgards   r�test_module_getattr_errorsz&ModuleTests.test_module_getattr_errors�s���2�2�1��������"��������+�
�
�
�y�
)��H�H�*�
�
�
�y�
)����*��K�K�6�7�*�c�k�k�9����;�<�:�*�
)��
)�
)�s�
C�
C�C�C'c�r�ddlmcm}|jt	|�gd��t
jd=y)Nr)�a�b�crV)rWrXrYrrr^r_)r"r`s  r�test_module_dirzModuleTests.test_module_dir�s)��3�3�����S��?�3��K�K�7�8r
c�`�ddlmcm}ddlm}|jt�5t|�ddd�|jt�5t|�ddd�tjd=dtjvrtjd=yy#1swY�hxYw#1swY�KxYw)Nrrcrerf)
rgrXrhrirdrjrkrr^r_rms   r�test_module_dir_errorsz"ModuleTests.test_module_dir_errors�s{��2�2�1�
�
�
�y�
)���H�*�
�
�
�y�
)����*��K�K�6�7�*�c�k�k�9����;�<�:�*�
)��
)�
)�s�B�B$�B!�$B-c�0�ddlm}|jt�5|jddd�|jt�5|j
ddd�dtjvrtjd=yy#1swY�XxYw#1swY�:xYw)Nr)�bad_getattr3ztest.test_module.bad_getattr3)rirxrjr �one�
delgetattrr^r_)r"rxs  r�test_module_getattr_trickyz&ModuleTests.test_module_getattr_tricky�sk��1�
�
�
�~�
.����/�
�
�
�~�
.��#�#�/�*�c�k�k�9����;�<�:�	/�
.��
.�
.�s�
B�
B�B	�Bc�T�td�}|`|jt|�d�y)Nr#z<module '?'>)rr	rr�r"rKs  r�test_module_repr_minimalz$ModuleTests.test_module_repr_minimal�s%���u���
�J�����a��.�1r
c�P�td�}|jt|�d�y�Nr#z<module 'foo'>)rrrr}s  r�test_module_repr_with_namez&ModuleTests.test_module_repr_with_name�s!���u�������a��"2�3r
c�^�td�}d|_|jt|�d�y�Nr#�/tmp/foo.pyz!<module 'foo' from '/tmp/foo.py'>)r�__file__rrr}s  r�'test_module_repr_with_name_and_filenamez3ModuleTests.test_module_repr_with_name_and_filename�s(���u���"��
�����a��"E�Fr
c�b�td�}|`d|_|jt	|�d�y)Nr#r�z<module '?' from '/tmp/foo.py'>)rr	r�rrr}s  r�#test_module_repr_with_filename_onlyz/ModuleTests.test_module_repr_with_filename_only�s-���u���
�J�"��
�����a��"C�Dr
c�l�td�}|j�J�|jt|�d�yr�)rr0rrr}s  r�$test_module_repr_with_loader_as_Nonez0ModuleTests.test_module_repr_with_loader_as_None�s1���u����|�|�#�#�#�����a��"2�3r
c��td�}|`t|_t	t�}|jt	|�dj
|��y�Nr#z<module '?' ({})>)rr	rr0rr�format�r"rK�loader_reprs   r�-test_module_repr_with_bare_loader_but_no_namez9ModuleTests.test_module_repr_with_bare_loader_but_no_name�sE���u���
�J�!����:�&�������G�(�/�/��<�	>r
c��td�}|`t|_t	t�}|jt	|�dj
|��yr�)rr	rr0rrr�r�s   r�-test_module_repr_with_full_loader_but_no_namez9ModuleTests.test_module_repr_with_full_loader_but_no_name�sG��
�u���
�J�!����:�&�������G�(�/�/��<�	>r
c��td�}t|_tt�}|j	t|�dj|��y)Nr#z<module 'foo' ({})>)rrr0rrr�)r"rK�module_reprs   r�!test_module_repr_with_bare_loaderz-ModuleTests.test_module_repr_with_bare_loader�sA���u���!����:�&�������G�*�1�1�+�>�	@r
c�v�td�}t|_|jt	|�dt
�d��y)Nr#z<module 'foo' (<class 'z.FullLoader'>)>)rrr0rrr	r}s  r�!test_module_repr_with_full_loaderz-ModuleTests.test_module_repr_with_full_loader�s5���u���!��������G�.�x�j��H�	Jr
c�t�td�}t|_d|_|j	t|�d�yr�)rrr0r�rrr}s  r�.test_module_repr_with_bare_loader_and_filenamez:ModuleTests.test_module_repr_with_bare_loader_and_filename��/���u���!���"��
�����a��"E�Fr
c�t�td�}t|_d|_|j	t|�d�yr�)rrr0r�rrr}s  r�.test_module_repr_with_full_loader_and_filenamez:ModuleTests.test_module_repr_with_full_loader_and_filename�r�r
c�B�|jtt�d�y)Nz<module 'sys' (built-in)>)rrr^)r"s r�test_module_repr_builtinz$ModuleTests.test_module_repr_builtins������c��$?�@r
c���tt�}d}d}|j|dt|�|dj	||��|j|t|�d|dj	||��y)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_withs    r�test_module_repr_sourcez#ModuleTests.test_module_repr_sourcesv����N��1��#�	�����,�C��,�-�{�8�?�?��;�O�	Q�����C�	�N�?�+�,�i�6�=�=�a��K�	Mr
c���td�}tjjddgd�}tjj	d|�}||_||_|jt|�d�y)Nr#r>�bazz'<module 'foo' (namespace) from ['bar']>)	r�	importlib�	machinery�NamespaceLoader�
ModuleSpecr0r2rr)r"rK�loader�specs    r�'test_module_repr_with_namespace_packagez3ModuleTests.test_module_repr_with_namespace_packagesc���u����$�$�4�4�U�U�G�U�K���"�"�-�-�e�V�<�������
�����a��"K�Lr
c��td�}t�}tjj	d|�}||_||_d}|jt|�|�|jdt|��y)Nr#�0<module 'foo' \(<.*\.BareLoader object at .+>\)>�from)
rrr�r�r�r0r2�assertRegexr�assertNotIn�r"rKr�r��expected_repr_patterns     r�9test_module_repr_with_namespace_package_and_custom_loaderzEModuleTests.test_module_repr_with_namespace_package_and_custom_loadersh���u�������"�"�-�-�e�V�<�������
� S������a��"7�8������a��)r
c�
�td�}t�}dg|_tjjd|�}||_||_d}|jt|�|�|jdt|��y)Nr#�spamr�r�)rr�_pathr�r�r�r0r2r�rr�r�s     r�,test_module_repr_with_fake_namespace_packagez8ModuleTests.test_module_repr_with_fake_namespace_packagesq���u�������x����"�"�-�-�e�V�<�������
� S������a��"7�8������a��)r
c��tdd�\}}}|j|�|j�}|jt	|�hd��y)Nz-cz$from test.test_module 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�liness     r�$test_module_finalization_at_shutdownz0ModuleTests.test_module_finalization_at_shutdown)sH��'��.T�U���C���������� ������U��&'�	(r
c���Gd�d��G�fd�dt�}|jtt|d�d�y)Nc��eZdZd�Zy)�;ModuleTests.test_descriptor_errors_propagate.<locals>.Descrc��t��N)�RuntimeError)r"�o�ts   r�__get__zCModuleTests.test_descriptor_errors_propagate.<locals>.Descr.__get__8s��"�"r
N)r	r
rr�rr
r�Descrr�7s��
#r
r�c���eZdZW��Zy)�7ModuleTests.test_descriptor_errors_propagate.<locals>.MN)r	r
r�melon)r�s�r�Mr�:s
����G�Er
r��mymodr�)rrjr�r))r"r�r�s  @r� test_descriptor_errors_propagatez,ModuleTests.test_descriptor_errors_propagate6s1���	#�	#�	�
�	����,���7��W�Er
c�f�td�}td�D]�}|jd|jv�|j}|jd|jv�|j
|j|�|j
|jd|�|dzr|`��|jd=��y)Nr#rD�__annotations__rU)r�ranger�rr�rr�r"r#�ir@s    r�test_lazy_create_annotationsz(ModuleTests.test_lazy_create_annotations>s��������q��A����.�#�,�,�>�?��#�#�A��O�O�-����=�>����S�0�0�!�4����S�\�\�*;�<�a�@��1�u��'��L�L�!2�3�r
c�l�td�}td�D]�}|jd|jv�dti}||_|j
d|jv�|j|j
|�|j|jd|�|dzr|`��|jd=��y)Nr#rDr�rqrU)rr�r�r�intr�rrr�s    r�test_setting_annotationsz$ModuleTests.test_setting_annotationsNs��������q��A����.�#�,�,�>�?��c�
�A�"#�C���O�O�-����=�>����S�0�0�!�4����S�\�\�*;�<�a�@��1�u��'��L�L�!2�3�r
c��td�}i|_|`|jt�5|`ddd�y#1swYyxYwrN)rr�rjr r*s  r�test_annotations_getset_raisesz*ModuleTests.test_annotations_getset_raises\s:������ �����
�
�
�~�
.��#�/�
.�
.�s�6�?c��tjd�}|jd|jv�|`|jd|jv�y)Nztest.typinganndata.ann_module4r�)r�import_fresh_modulerrr�r�)r"�ann_module4s  r�&test_annotations_are_created_correctlyz2ModuleTests.test_annotations_are_created_correctlydsO��#�7�7�,�
��	
���)�[�-A�-A�A�B��'����*�k�.B�.B�B�Cr
c���td�}|j}d}td�D])}d|_||jz
}|j	d��+|j|d�y)NrTr�drH�attr)rrr�r��popr)r"rKr@�count�_s     r�test_repeated_attribute_popsz(ModuleTests.test_repeated_attribute_popsms[��
�v���
�J�J�����s��A��A�F��Q�V�V�O�E�
�E�E�&�M��	
�����$r
c��Gd�dt�}|d�}|jt�5|jddd�|jt�5|jddd�d\|_|_|j|jd�|j|jd�y#1swY�{xYw#1swY�]xYw)Nc�"��eZdZdZ�fd�Z�xZS)�=ModuleTests.test_subclass_with_slots.<locals>.ModuleWithSlots)rqrrc�$��t�|�|�yr�)�superr?)r"�name�	__class__s  �rr?zFModuleTests.test_subclass_with_slots.<locals>.ModuleWithSlots.__init__�s����� ��&r
)r	r
r�	__slots__r?�
__classcell__)r�s@r�ModuleWithSlotsr�~s���"�I�
'�
'r
r�r�)rHrUrHrU)rrjr rqrrr)r"r�rKs   r�test_subclass_with_slotsz$ModuleTests.test_subclass_with_slots{s���	'�j�	'�
�F�#��
�
�
�~�
.�
�C�C�/�
�
�
�~�
.�
�C�C�/�����Q�S�������a� �������a� �
/�
.��
.�
.�s�
B4�
C�4B=�C	N)*r	r
rr%r+r-r4r8r;rArFrLrRrarortrvr{r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
rrrs���@�*�*�
;�-�-�+�1�
)�"�
9�=�9�
	=�=�2�4�G�
E�4�
>�
>�@�J�G�G�A�M�M�*�	*�(�F�4� 4�$�D�
%�!r
r�__main__)�importlib.machineryr�r�rO�test.supportrr�test.support.script_helperrr^�typerrr�TestCaserr	�mainrr
r�<module>rsf�����#�&�7�
�
�#�Y�
�	�	�	�	�v!�(�#�#�v!�t�z���H�M�M�O�r

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