Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_importlib/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_importlib/__pycache__/test_abc.cpython-312.opt-1.pyc

�

)Μg�z��f�ddlZddlZddlZddlZddlmZddlZddlZddlmZddl	Z	ddl
mZejd�Zejd�Zejd�Zejd�ZGd	�d
�ZGd�de�Zej&ee�
�\ZZGd�de�Zej&ee�
�\ZZGd�de�Zej&ee�
�\ZZGd�de�Zej&ee�
�\ZZGd�de�Zej&ee�
�\Z Z!Gd�de�Z"ej&e"e�
�\Z#Z$Gd�de�Z%ej&e%e�
�\Z&Z'dSd�Z(Gd�d�Z)Gd�d�ZGd�de)�Z*ej&e*�\Z+Z,Gd �d�ZGd!�d"e)�Z-ej&e-�\Z.Z/Gd#�d$�Z0Gd%�d&e)�Z1ej&e1�\Z2Z3Gd'�de0�ZGd(�d)e)�Z4ej&e4�\Z5Z6Gd*�de0�Ze(e�Z7Gd+�d,e)�Z8ej&e8�\Z9Z:Gd-�de�Ze(e�Z;Gd.�d/e)�Z<ej&e8�\Z=Z>Gd0�d1�Z?Gd2�d3�Z@ej&e@ee�4�\ZAZBGd5�d6�ZCej&eCee�4�\ZDZEGd7�d8�ZFej&eFe7�9�\ZGZHGd:�d;�ZIej&eIe7�9�\ZJZKGd<�d=�ZLej&eLe7ee�>�\ZMZNGd?�d@�ZOej&eOe;�A�\ZPZQGdB�dC�ZRe(eRd�ZSGdD�deR�Z%e(e%ee�E�ZTGdF�dG�ZUGdH�dIeU�ZVej&eVeeS�J�\ZWZXej�ej�dK�GdL�dMeU��Z[ej&e[eeeT�N�\Z\Z]GdO�dP�Z^ej&e^eS�Q�\Z_Z`eadRk(rej��yy)T�N)�
import_helper)�mock)�util�	importlibz
importlib.abczimportlib.machineryzimportlib.utilc�*�eZdZdZgZgZd�Zd�Zd�Zy)�InheritanceTestszSTest that the specified class is a subclass/superclass of the expected
    classes.c�^�|jD�cgc]}t|j|���c}|_t	|d�r?|jj
}|jD�cgc]}t||���c}|_t|j|j�|_	ycc}wcc}w)N�subclass_names)
�superclass_names�getattr�abc�superclasses�hasattr�	machineryr
�
subclasses�_NAME�_InheritanceTests__test)�self�
class_namers   �9/usr/local/lib/python3.12/test/test_importlib/test_abc.py�setUpzInheritanceTests.setUps���/3�/D�/D�F�/D��%�T�X�X�z�:�/D�F����4�)�*����*�*�I�15�1D�1D�F�1D�:� '�y�*�=�1D�F�D�O��d�h�h��
�
�3����F��Fs�B%�$B*c��|jD]B}|jt||j�dj	||j���Dy)Nz{0} is not a subclass of {1})r�
assertTrue�
issubclassr�format)r�subclasss  r�test_subclassesz InheritanceTests.test_subclasses+s>�����H��O�O�J�x����=�.�5�5�h����L�
N�(�c��|jD]B}|jt|j|�dj	||j���Dy)Nz{0} is not a superclass of {1})rrrrr)r�
superclasss  r�test_superclassesz"InheritanceTests.test_superclasses1s@���+�+�J��O�O�J�t�{�{�J�?�/�6�6�z�4�;�;�O�
Q�,rN)	�__name__�
__module__�__qualname__�__doc__rrrrr!�rrrrs$����J��L�
4�N�Qrrc��eZdZgZgd�Zy)�MetaPathFinder)�BuiltinImporter�FrozenImporter�
PathFinder�WindowsRegistryFinderN�r"r#r$rr
r&rrr(r(8s����/�Nrr()r
c��eZdZgZdgZy)�PathEntryFinder�
FileFinderNr-r&rrr/r/Cs����"�^�Nrr/c��eZdZdgZy)�ResourceLoader�LoaderN)r"r#r$rr&rrr2r2Ms
�� �z�rr2c��eZdZdgZgd�Zy)�
InspectLoaderr3)r)r*�ExtensionFileLoaderNr-r&rrr5r5Vs�� �z��Q�Nrr5c��eZdZdgZdgZy)�ExecutionLoaderr5r6Nr-r&rrr8r8`s��'�(��+�,�Nrr8c��eZdZddgZddgZy)�
FileLoaderr2r8�SourceFileLoader�SourcelessFileLoaderNr-r&rrr:r:js��(�*;�<��(�*@�A�Nrr:c��eZdZddgZdgZy)�SourceLoaderr2r8r;Nr-r&rrr>r>ts��(�*;�<��(�)�Nrr>c	��|�|j}tj�D��cic]\}}|t||���}}}t	j
||fi|��D�cic]}|j|r|�n|��c}Scc}}wcc}w�N)r"r
�itemsr�	test_util�split_frozen�_KIND)�
base_class�name�inst�kwargs�kind�splitabc�base�clss        r�make_abc_subclassesrM�s����|��"�"��"%�)�)�+�/�"-���h�
�'�(�D�)�)�"-�	�/�!�-�-�j�$�I�&�I�K�I��
�I�I��s�u�#�-�I�K�K��/��Ks�A9�A?c��eZdZed��Zy)�ABCTestHarnessc�h�|j|j}|�}||j_|Sr@)�SPLITrD�	__class__�ins)rrLrSs   rrSzABCTestHarness.ins�s.���j�j����$���e�� ������
rN)r"r#r$�propertyrSr&rrrOrO�s��
���rrOc��eZdZy)r(N�r"r#r$r&rrr(r(����rc�"�eZdZee�Zd�Zy)�MetaPathFinderDefaultsTestsc�8�|jj�yr@�rS�invalidate_caches�rs r�test_invalidate_cachesz2MetaPathFinderDefaultsTests.test_invalidate_caches�������"�"�$rN)r"r#r$rMr(rQr^r&rrrYrY�s����/�E�%rrYc��eZdZy)r/NrVr&rrr/r/�rWrc�"�eZdZee�Zd�Zy)�PathEntryFinderDefaultsTestsc�8�|jj�yr@r[r]s rr^z3PathEntryFinderDefaultsTests.test_invalidate_caches�r_rN)r"r#r$rMr/rQr^r&rrrbrb�s����0�E�%rrbc��eZdZy)r3NrVr&rrr3r3�rWrr3c�.�eZdZee�Zd�Zd�Zd�Zy)�LoaderDefaultsTestsc�\�d}|j|jj|��y)Nza spec)�assertIsNonerS�
create_module)r�specs  r�test_create_modulez&LoaderDefaultsTests.test_create_module�s$�������$�(�(�0�0��6�7rc��|jt�5|jjd�ddd�y#1swYyxYw)N�	something)�assertRaises�ImportErrorrS�load_moduler]s r�test_load_modulez$LoaderDefaultsTests.test_load_module�s.��
�
�
�{�
+��H�H� � ��-�,�
+�
+��	�;�Ac� �tjd�}tj�5tjdt
�t
|�}|j|_|jt
|��ddd�y#1swYyxYw)N�blah�ignore)
�types�
ModuleType�warnings�catch_warnings�simplefilter�DeprecationWarning�reprrS�
__loader__r)r�mod�
original_reprs   r�test_module_reprz$LoaderDefaultsTests.test_module_repr�s_�����v�&��
�
$�
$�
&��!�!�(�,>�?� ��I�M�!�X�X�C�N��O�O�D��I�&�'�
&�
&�s�AB�B
N)	r"r#r$rMr3rQrkrqr�r&rrrfrf�s����'�E�8�.�'rrfc���eZdZ�fd�Z�xZS)r2c�"��t�|�|�Sr@)�super�get_data�r�pathrRs  �rr�zResourceLoader.get_data�s����w���%�%r)r"r#r$r��
__classcell__�rRs@rr2r2�s
���&�&rc�"�eZdZee�Zd�Zy)�ResourceLoaderDefaultsTestsc��|jt�5|jjd�ddd�y#1swYyxYw)Nz
/some/path)rn�IOErrorrSr�r]s r�
test_get_dataz)ResourceLoaderDefaultsTests.test_get_data�s.��
�
�
�w�
'��H�H���l�+�(�
'�
'�rrN)r"r#r$rMr2rQr�r&rrr�r��s����/�E�,rr�c�(��eZdZ�fd�Z�fd�Z�xZS)r5c�"��t�|�|�Sr@)r��
is_package�r�fullnamerRs  �rr�zInspectLoader.is_package������w�!�(�+�+rc�"��t�|�|�Sr@)r��
get_sourcer�s  �rr�zInspectLoader.get_source�r�r)r"r#r$r�r�r�r�s@rr5r5�s���,�,�,rc��eZdZeZd�Zd�Zy)�InspectLoaderDefaultsTestsc��|jt�5|jjd�ddd�y#1swYyxYw�Nrt)rnrorSr�r]s r�test_is_packagez*InspectLoaderDefaultsTests.test_is_package��.��
�
�
�{�
+��H�H����'�,�
+�
+�rrc��|jt�5|jjd�ddd�y#1swYyxYwr�)rnrorSr�r]s r�test_get_sourcez*InspectLoaderDefaultsTests.test_get_sourcer�rrN)r"r#r$�SPLIT_ILrQr�r�r&rrr�r��s���E�(�(rr�c���eZdZ�fd�Z�xZS)r8c�"��t�|�|�Sr@)r��get_filenamer�s  �rr�zExecutionLoader.get_filenames����w�#�H�-�-r)r"r#r$r�r�r�s@rr8r8s
���.�.rc��eZdZeZd�Zy)�ExecutionLoaderDefaultsTestsc��|jt�5|jjd�ddd�y#1swYyxYwr�)rnrorSr�r]s r�test_get_filenamez.ExecutionLoaderDefaultsTests.test_get_filenames.��
�
�
�{�
+��H�H�!�!�&�)�,�
+�
+�rrN)r"r#r$�SPLIT_ELrQr�r&rrr�r�s���E�*rr�c�<��eZdZ�fd�Z�fd�Z�fd�Z�fd�Z�xZS)�ResourceReaderc�"��t�|�|i|��Sr@)r��
open_resource�r�argsrHrRs   �rr�zResourceReader.open_resource%�����w�$�d�5�f�5�5rc�"��t�|�|i|��Sr@)r��
resource_pathr�s   �rr�zResourceReader.resource_path(r�rc�"��t�|�|i|��Sr@)r��is_resourcer�s   �rr�zResourceReader.is_resource+s����w�"�D�3�F�3�3rc�"��t�|�|i|��Sr@)r��contentsr�s   �rr�zResourceReader.contents.s����w���0��0�0r)r"r#r$r�r�r�r�r�r�s@rr�r�#s���6�6�4�1�1rr�c�.�eZdZed��Zd�Zd�Zd�Zy)�MetaPathFinderFindModuleTestsc�T��G�fd�d|jj�}|�S)Nc���eZdZd�fd�	Zy)�@MetaPathFinderFindModuleTests.finder.<locals>.MetaPathSpecFinderNc���||f|_�Sr@)�
called_for)rr�r��targetrjs    �r�	find_speczJMetaPathFinderFindModuleTests.finder.<locals>.MetaPathSpecFinder.find_spec9s���"*�D�.����rr@)r"r#r$r�)rjs�r�MetaPathSpecFinderr�7s���
rr�)r
r()rLrjr�s ` r�finderz$MetaPathFinderFindModuleTests.finder5s$���	����!7�!7�	�"�#�#rc��t�}|jjd|�}|j|�}|j	ddd�}|j||�yr�)�objectr�spec_from_loaderr�r��assertEqual�r�loaderrjr��founds     r�#test_find_spec_with_explicit_targetzAMetaPathFinderFindModuleTests.test_find_spec_with_explicit_target?sQ������y�y�)�)�&�&�9�����T�"��� � ����6�������%rc��|jd�}gd�}d}|j||d�}|j|�|j||jd�|j||jd�y)N)�a�b�crtr�)r�r�rhr�r�)rr�r�rFr�s     r�test_no_specz*MetaPathFinderFindModuleTests.test_no_specFsr�����T�"������� � ��t�T�2�����%� �����v�0�0��3�4�����v�0�0��3�4rc��t�}|jjd|�}|j|�}|j	dd�}|j||�yr�)r�rr�r�r��assertIsr�s     r�	test_specz'MetaPathFinderFindModuleTests.test_specOsM������y�y�)�)�&�&�9�����T�"��� � ���.���
�
�e�T�"rN)r"r#r$�classmethodr�r�r�r�r&rrr�r�3s#���$��$�&�5�#rr�)r
rc��eZdZd�Zd�Zd�Zy)�LoaderLoadModuleTestsc�N�Gd�d|jj�}|�S)Nc��eZdZdZd�Zd�Zy)�0LoaderLoadModuleTests.loader.<locals>.SpecLoaderNc��||_yr@)r��r�modules  r�exec_modulez<LoaderLoadModuleTests.loader.<locals>.SpecLoader.exec_modulebs	��#��
rc��y)z.Force some non-default module state to be set.Tr&�rr�s  rr�z;LoaderLoadModuleTests.loader.<locals>.SpecLoader.is_packagees��r)r"r#r$r�r�r�r&rr�
SpecLoaderr�`s���E�
$�
rr�)r
r3)rr�s  rr�zLoaderLoadModuleTests.loader_s ��	������	��|�rc� �tj�5tjdt�|j	�}d}tj|�5|j|�|j}|jtj||�ddd�|j|j�|j||jj�|j||j�|j||jj �|j#|j$�|j#|j$|jj&�ddd�y#1swY��xYw#1swYyxYw�Nrurt)rxryrzr{r�rB�uncacherpr�r��sys�modulesr�r}�__spec__r"rF�assertIsNotNone�__path__�submodule_search_locations)rr�rFr�s    r�
test_freshz LoaderLoadModuleTests.test_freshks��
�
$�
$�
&��!�!�(�,>�?��[�[�]�F��D��"�"�4�(��"�"�4�(������
�
�c�k�k�$�/��8�)�
���V�V�%6�%6�7����V�V�_�_�%;�%;�<����T�6�?�?�3����T�6�?�?�#7�#7�8�� � ����1�� � ���� &��� J� J�
L�'�
&�)�(��	'�
&�s&�AF�AE8�CF�8F	�=F�F
c�h�tj�5tjdt�d}|j	�}tj|�}|jj||�|_	||_
tj|�5|tj|<|j|�|j }|j#|tj|�|j#|tj|�ddd�ddd�y#1swY�xYw#1swYyxYwr�)rxryrzr{r�rvrwrr�r�r}rBr�r�r�rpr�r�)rrFr�r�r�s     r�test_reloadz!LoaderLoadModuleTests.test_reload|s���
�
$�
$�
&��!�!�(�,>�?��D��[�[�]�F��%�%�d�+�F�"�i�i�8�8��v�F�F�O� &�F���"�"�4�(�$*����D�!��"�"�4�(������
�
�e�S�[�[��%6�7��
�
�f�c�k�k�$�&7�8�)�'�
&�)�(��'�
&�s%�A?D(�A7D�D(�D%	�!D(�(D1N)r"r#r$r�r�r�r&rrr�r�]s��
�L�"
9rr�c�,�eZdZdd�Zd�Zd�Zd�Zd�Zy)�InspectLoaderSourceToCodeTestsNc���tjd�}|j�}|�|j|�}n|j||�}t	||j
�|S)z!Help with source_to_code() tests.rt)rvrw�InspectLoaderSubclass�source_to_code�exec�__dict__)r�datar�r�r��codes      r�source_to_modulez/InspectLoaderSourceToCodeTests.source_to_module�sZ���!�!�&�)���+�+�-���<��(�(��.�D��(�(��t�4�D��T�6�?�?�#��
rc��d}|j|�}|jt|d��|j|jd�y)N�	attr = 42�attr�*�r�rrr�r��r�sourcer�s   r�test_source_to_code_sourcez9InspectLoaderSourceToCodeTests.test_source_to_code_source�s>�����&�&�v�.��������/�0�������b�)rc��d}|j|�}|jt|d��|j|jd�y)Ns	attr = 42r�r�r�r�s   r�test_source_to_code_bytesz8InspectLoaderSourceToCodeTests.test_source_to_code_bytes�s>�����&�&�v�.��������/�0�������b�)rc��d}|j�}|jd|�}|j|j|�y)Nzpath/to/somewhere��r�r�r��co_filename)rr�r�r�s    r�test_source_to_code_pathz7InspectLoaderSourceToCodeTests.test_source_to_code_path�s=��"���+�+�-���$�$�R��.������)�)�4�0rc�~�|j�}|jd�}|j|jd�y)Nr��<string>r�)rr�r�s   r�test_source_to_code_no_pathz:InspectLoaderSourceToCodeTests.test_source_to_code_no_path�s8���+�+�-���$�$�R�(������)�)�:�6rr@)r"r#r$r�r�r�rrr&rrr�r��s��	�*�*�1�7rr�)r�c��eZdZd�Zd�Zd�Zy)�InspectLoaderGetCodeTestsc�`�tjd�}tjj	|j
d�5}d|_|j�}|jd�}ddd�t|j�|j|jd�y#1swY�<xYw)Nrtr�r�r�)rvrwr�patchr�r��return_value�get_coder�r�r�r�)rr��mockedr�r�s     r�
test_get_codez'InspectLoaderGetCodeTests.test_get_code�s����!�!�&�)��
�Z�Z�
�
�t�9�9�<�
H�F�"-�F���/�/�1�F��?�?�6�*�D�I�	
�T�6�?�?�#�������b�)�I�
H�s�)B$�$B-c���tjj|jd�5}d|_|j�}|jd�}ddd�|j
�y#1swY�xYw)Nr�rt)rrr�r�r	r
rh)rrr�r�s    r�test_get_code_source_is_Nonez6InspectLoaderGetCodeTests.test_get_code_source_is_None�sb��
�Z�Z�
�
�t�9�9�<�
H�F�"&�F���/�/�1�F��?�?�6�*�D�I�	
���$��	I�
H�s�)A.�.A7c��|j�}|jt�5|jd�ddd�y#1swYyxYwr�)r�rnror
�rr�s  r�test_get_code_source_not_foundz8InspectLoaderGetCodeTests.test_get_code_source_not_found�s6���+�+�-��
�
�
�{�
+��O�O�F�#�,�
+�
+���A�A
N)r"r#r$rrrr&rrrr�s��*� �$rrc�8�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�InspectLoaderLoadModuleTestsz!Test InspectLoader.load_module().rtc��tj|j�|jtj|j�yr@)r�unload�module_name�
addCleanupr]s rrz"InspectLoaderLoadModuleTests.setUp�s0�����T�-�-�.����
�,�,�d�.>�.>�?rc� �|jj|j|�}tj�5tj
dt�|jjj|�cddd�S#1swYyxYw�Nru)
rr�rrxryrzr{�init�
_bootstrap�_load_unlocked)rr�rjs   r�loadz!InspectLoaderLoadModuleTests.load�s_���y�y�)�)�$�*:�*:�F�C��
�
$�
$�
&��!�!�(�,>�?��9�9�'�'�6�6�t�<�'�
&�
&�s�?B�B
c�V�tjj|jd�S)Nr
)rrr�r�r]s r�
mock_get_codez*InspectLoaderLoadModuleTests.mock_get_code�s���z�z� � ��!;�!;�Z�H�Hrc��|j�5}t|_|jt�5|j	�}|j|�ddd�ddd�y#1swY�xYw#1swYyxYwr@)r ro�side_effectrnr�r�r�mocked_get_coder�s   r�test_get_code_ImportErrorz6InspectLoaderLoadModuleTests.test_get_code_ImportError�s]��
�
�
�
!�_�*5�O�'��"�"�;�/��3�3�5���	�	�&�!�0�"�
!�/�/��"�
!�s"�!A1�"A%�A1�%A.	�*A1�1A:c���|j�5}d|_|jt�5|j	�}|j|�ddd�ddd�y#1swY�xYw#1swYyxYwr@)r r	rnror�rr#s   r�test_get_code_Nonez/InspectLoaderLoadModuleTests.test_get_code_None�s]��
�
�
�
!�_�+/�O�(��"�"�;�/��3�3�5���	�	�&�!�0�"�
!�/�/��"�
!�s"�A-�"A!�A-�!A*	�&A-�-A6c��tddd�}|j�5}||_|j�}|j	|�}|j|tj|j�ddd�y#1swYyxYw)Nr�rr�)	�compiler r	r�rr�r�r�r)rr�r$r�r�s     r�test_module_returnedz1InspectLoaderLoadModuleTests.test_module_returnedsm���{�J��7��
�
�
�
!�_�+/�O�(��/�/�1�F��Y�Y�v�&�F����V�S�[�[��1A�1A�%B�C�	"�
!�
!�s�AA=�=BN)r"r#r$r%rrrr r%r'r*r&rrrr�s+��+��K�@�=�I�"�"�Drr)r�rrc�2�eZdZddd�d�Zd�Zd�Zd�Zd�Zy)	�ExecutionLoaderGetCodeTestsF�r�r�c���d\}}|r*tjj|jd�}|r*tjj|jd�}||fS)N)NNr�r�)rrr��ExecutionLoaderSubclass)rr�r��source_mock_context�filename_mock_contexts     r�mock_methodsz(ExecutionLoaderGetCodeTests.mock_methodssb��5?�2��2��"&�*�*�"3�"3�D�4P�4P�4@�#B���$(�J�J�$5�$5�d�6R�6R�6D�%F�!�"�$9�9�9rc��d}|jdd��\}}|5}|5}d|_||_|j�}|jd�}ddd�ddd�|j	j
|�t
jd�}t||j�|j	|jd�y#1swY�uxYw#1swY�yxYw)Nzblah.pyTr-r�rtr�)r2r	r/r
r�rrvrwr�r�r�)	rr�r0r1�source_mock�	name_mockr�r�r�s	         rrz)ExecutionLoaderGetCodeTests.test_get_code%s�����59�5F�5F��d�6G�64�2��2�
 �K�1F�)�'2�K�$�%)�I�"��1�1�3�F��?�?�6�*�D�	2G�
 �
	
����)�)�4�0��!�!�&�)���T�6�?�?�#�������b�)�2G�1F��
 �
 �s"�C�0C�C�C	�C�Cc���|jd��\}}|5}d|_|j�}|jd�}ddd�|j	�y#1swY�xYw)NT)r�rt)r2r	r/r
rh)rr0�_rr�r�s      rrz8ExecutionLoaderGetCodeTests.test_get_code_source_is_None3sb��!%�!2�!2�d�!2�!C���Q�
 �F�"&�F���1�1�3�F��?�?�6�*�D�!�	
���$��	!�
 �s�)A�A$c��|j�}|jt�5|jd�ddd�y#1swYyxYwr�)r/rnror
rs  rrz:ExecutionLoaderGetCodeTests.test_get_code_source_not_found<s6���-�-�/��
�
�
�{�
+��O�O�F�#�,�
+�
+�rc��|jdd��\}}|5}|5}d|_t|_|j	�}|jd�}ddd�ddd�|j
jd�tjd�}t||j�|j
|jd�y#1swY�uxYw#1swY�yxYw)NTr-r�rtrr�)
r2r	ror"r/r
r�rrvrwr�r�r�)rr0r1r4r5r�r�r�s        r�test_get_code_no_pathz1ExecutionLoaderGetCodeTests.test_get_code_no_pathBs���6:�5F�5F��d�6G�64�2��2�
 �K�1F�)�'2�K�$�$/�I�!��1�1�3�F��?�?�6�*�D�	2G�
 �
	
����)�)�:�6��!�!�&�)���T�6�?�?�#�������b�)�2G�1F��
 �
 �s"�C�4C�C�C
	�	C�CN)r"r#r$r2rrrr:r&rrr,r,s ��).�U�:�*� �$�
*rr,)r/c�"�eZdZdZd�Zd�Zd�Zy)�SourceOnlyLoadersN_ = '::'.join([__name__, __file__, __cached__, __package__, repr(__loader__)])c��||_yr@�r��rr�s  r�__init__zSourceOnlyLoader.__init___s	����	rc�D�||jk7rt�|jSr@)r�r�r�r?s  rr�zSourceOnlyLoader.get_databs���4�9�9���M��{�{�rc��|jSr@r>r�s  rr�zSourceOnlyLoader.get_filenamegs���y�y�rN)r"r#r$r�r@r�r�r&rrr<r<Ys��$�F���
rr<c�:��eZdZdZd�fd�	Z�fd�Zd�Zd�Z�xZS)r>r�c����t�|�|�|jj|j�|_t
|j�|_|�|jj}t|�}|j|jjd��|j|jj|j��|j|jj|j��t|j|jdd��}|jt!j"|��t%|�|_i|_y)Nrr�T)�dont_inherit)r�r@r�cache_from_sourcer��
bytecode_path�lenr��source_size�MAGIC_NUMBER�	bytearray�extendr�_pack_uint32�source_mtimer)�marshal�dumps�bytes�bytecode�written)rr��magicr��code_objectrRs     �rr@zSourceLoader.__init__rs����
�����!�Y�Y�8�8����C����t�{�{�+����=��I�I�*�*�E��������D�I�I�*�*�1�-�.����D�I�I�*�*�4�+<�+<�=�>����D�I�I�*�*�4�+;�+;�<�=��d�k�k�4�9�9�f�-1�3�����G�M�M�+�.�/��d���
���rc���||jk(rt�|�	|�S||jk(r|jSt
�r@)r�r�r�rGrR�OSErrorr�s  �rr�zSourceLoader.get_data�s<����4�9�9���7�#�D�)�)�
�T�'�'�
'��=�=� ��Mrc�^�||jk7rt�|j|jd�S)N)�mtime�size)r�r�rNrIr?s  r�
path_statszSourceLoader.path_stats�s*���4�9�9���M��*�*�D�4D�4D�E�Erc�P�t|�|j|<||jk(Sr@)rQrSrG)rr�r�s   r�set_datazSourceLoader.set_data�s%��"�4�[����T���t�)�)�)�)rr@)	r"r#r$rNr@r�r[r]r�r�s@rr>r>ns����L�� �F�
*r)rrc�$�eZdZdd�d�Zd�Zd�Zy)�SourceLoaderTestHarnessT�r�c��d|_|rAtjj|jd�|_|j|_ndd}tjj|jdjddg��|_dj|j|g�|_|j
j
|j�|_|j|jfi|��|_	y)N�pkgz__init__.pyr~�.�py)
�package�osr��joinrFrrF�cached�loader_mockr�)rr�rHrs    rrzSourceLoaderTestHarness.setUp�s������������T�\�\�=�A�D�I����D�I��K������T�\�\�3�8�8�U�D�M�3J�K�D�I����$�,�,��!<�=�D�I��i�i�1�1�$�)�)�<���&�d�&�&�t�y�y�;�F�;��rc��|j|j|j�|j|j|j�|j|j
|j�|j|j|j�|j|j|j�|jjd�}|j|d|j�|j|d|j�|j|d|j�|j|d|j�|j|dt|j��y)Nz::rr����)r�r"rF�__file__r��
__cached__rh�__package__rer}r�r7�splitr|)rr��valuess   r�
verify_modulez%SourceLoaderTestHarness.verify_module�s��������$�)�)�4�������$�)�)�4�����*�*�D�K�K�8�����+�+�T�\�\�:�����*�*�D�K�K�8�������%��������D�I�I�.�������D�I�I�.�������D�K�K�0�������D�L�L�1�������D����$5�6rc�&�tj|j�}|j|_|j
|_|j|_|j|_
g|_t||j�|j|�yr@)rvrwrFr�rnrhrorerpr�r}r�r�r�rs)rrUr�s   r�verify_codez#SourceLoaderTestHarness.verify_code�sh���!�!�$�)�)�,���)�)��� �K�K���!�\�\��� �K�K�������[�&�/�/�*����6�"rN)r"r#r$rrsrur&rrr_r_�s��"&�
<�7�#rr_c�:�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�SourceOnlyLoaderTestsz8Test importlib.abc.SourceLoader for source-only loading.c���|jjjd�}|j|jj	|j
�|�d�}||j_|jt�5}|jj	|j
�ddd�|jjj
|j
�y#1swY�:xYw)N�utf-8c��t�r@)rWr>s r�
raise_OSErrorz<SourceOnlyLoaderTests.test_get_source.<locals>.raise_OSError�s���Mr)
r�r��decoder�r�rFr�rnro�	exception)r�expected_sourcer{�cms    rr�z%SourceOnlyLoaderTests.test_get_source�s����+�+�,�,�3�3�G�<��������/�/��	�	�:�O�L�	�,�����
�
�
�{�
+�r��K�K�"�"�4�9�9�-�,�������*�*�D�I�I�6�,�
+�s�&C#�#C,c��|jd��|j|jj|j��|jd��|j|jj|j��|j|jj|jdz��y)NFr`Tz	.__init__)r�assertFalser�r�rFrr]s rr�z%SourceOnlyLoaderTests.test_is_package�s����
�
�e�
�$�������/�/��	�	�:�;��
�
�d�
�#�������.�.�t�y�y�9�:�������/�/��	�	�K�0G�H�Irc�p�|jj|j�}|j|�yr@�r�r
rFru�rrUs  rrz#SourceOnlyLoaderTests.test_get_code��(���k�k�*�*�4�9�9�5������%rc��|jj|jj|j�}|j	|�yr@)r�r�r�r�ru)rr�s  r�test_source_to_codez)SourceOnlyLoaderTests.test_source_to_code�s4���{�{�)�)�$�+�+�*<�*<�d�i�i�H������rc��tj�5tjdt�t	j
|j�5tj�5tjdt�|jj|j�}ddd�|j�|j|jtjj|j�g�|j!|jt"j$�ddd�ddd�y#1swY��xYw#1swY�xYw#1swYyxYwr)rxryrz�
ImportWarningrBr�rFr{r�rprsr�r�rfr��dirname�assertInr�r�r�s  rrqz&SourceOnlyLoaderTests.test_load_module�s����
$�
$�
&��!�!�(�M�:��"�"�4�9�9�-��,�,�.��)�)�(�4F�G�!�[�[�4�4�T�Y�Y�?�F�/��"�"�6�*�� � ����2�7�7�?�?�4�9�9�3M�2N�O��
�
�d�i�i����5�
.�'�
&�/�.��.�-��'�
&�s=�:E�E�$AD<�$BE�+E�<E�E�E	�
E�Ec�>�tj�5tjdt�|j	d��tj|j�5tj�5tjdt�|jj|j�}ddd�|j�|jt|d��ddd�ddd�y#1swY�FxYw#1swY�xYw#1swYyxYw)NruFr`r�)rxryrzr�rrBr�rFr{r�rprsr�rr�s  r�test_package_settingsz+SourceOnlyLoaderTests.test_package_settings�s����
$�
$�
&��!�!�(�M�:��J�J�%�J�(��"�"�4�9�9�-��,�,�.��)�)�(�4F�G�!�[�[�4�4�T�Y�Y�?�F�/��"�"�6�*�� � ����!<�=�.�'�
&�/�.��.�-��'�
&�s=�AD�!D�6AC;�64D�*D�;D�D�D	�D�Dc�h�d}|jd�|j_|jj|j�}|j||�d}|jd�|j_|jj|j�}|j||�y)Nu_ = 'ü'ryu# coding: latin-1
_ = ü�latin-1)�encoder�r�r�rFr�)rr��returned_sources   r�test_get_source_encodingz.SourceOnlyLoaderTests.test_get_source_encoding�s�����#�]�]�7�3������+�+�0�0����;������&�1�,��#�]�]�9�5������+�+�0�0����;������&�1rN)r"r#r$r%r�r�rr�rqr�r�r&rrrwrw�s)��B�
7�J�&�
�
6�>�
2rrw)rrizsys.dont_write_bytecode is truec�R��eZdZdZdd��fd�
Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Z�xZS)�SourceLoaderBytecodeTestszsTest importlib.abc.SourceLoader's use of bytecode.

    Source-only testing handled by SourceOnlyLoaderTests.

    F��bytecode_writtenc����t�|�|�|�rV|j|j|jj
�t
|jj�}|j|jjd��|j|jj|jj��|j|jj|jj��|jtj|��|j!|jj
|jt#|��yy)Nr)r�rur�rhr�rSrKrrJrLrrMrNrIrOrPr�rQ)rrUr�r�rRs    �rruz%SourceLoaderBytecodeTests.verify_codes����
���K�(���M�M�$�+�+�t�{�{�':�':�;��T�Y�Y�3�3�4�D��K�K��	�	�.�.�q�1�2��K�K��	�	�.�.�t�{�{�/G�/G�H�I��K�K��	�	�.�.�t�{�{�/F�/F�G�H��K�K��
�
�k�2�3����T�[�[�0�0����=�u�T�{�K�rc�p�|jj|j�}|j|�yr@r�r�s  r�test_code_with_everythingz3SourceLoaderBytecodeTests.test_code_with_everything!r�rc�j�d|j_|jt�5|jj|j�}|jj|�ddd�|jj|j�}|j|d��y#1swY�BxYw)N�<does not exist>Tr�)r�rGrnrWrrFr�r�r
rFru)rrGrUs   r�test_no_bytecodez*SourceLoaderBytecodeTests.test_no_bytecode&s���$6����!�
�
�
�w�
'� �I�I�7�7��	�	�B�M��K�K� � ��/�(��k�k�*�*�4�9�9�5������t��<�	(�
'�s�AB)�)B2c�B�dD]�}|jj}||j_|jjdd|j_|jj|j�}|j|d��||j_��y)N)rrk�Tr�)r�rNrRr
rFru)rrN�originalrUs    r�test_code_bad_timestampz1SourceLoaderBytecodeTests.test_code_bad_timestamp0s{��"�L��{�{�/�/�H�'3�D�K�K�$�#'�;�;�#7�#7���#;�D�K�K� ��+�+�.�.�t�y�y�9�K����[�4��@�'/�D�K�K�$�#rc���|jd��|jjdd|j_|jj|j�}|j|d��y)N�0000�rTr�Tr�)rr�rRr
rFrur�s  r�test_code_bad_magicz-SourceLoaderBytecodeTests.test_code_bad_magic<sX���
�
��
�!�#�{�{�3�3�A�B�7������k�k�*�*�4�9�9�5������t��<rc��	dt_d|j_|jj	|j
�}|j
|j|jj�dt_y#dt_wxYw)NTr�F)	r��dont_write_bytecoder�rGr
rF�assertNotInrhrSr�s  r�test_dont_write_bytecodez2SourceLoaderBytecodeTests.test_dont_write_bytecodeDsb��	,�&*�C�#�(:�D�K�K�%��+�+�.�.�t�y�y�9�K����T�[�[�$�+�+�*=�*=�>�&+�C�#��e�C�#�s�A1A?�?
Bc��|jd��|jjj�dj}	|jjj�d`|jj|j�}|j|�||jjj�d_y#||jjj�d_wxYw)Nr�r�r�)rr�rR�mror]r
rFru)r�original_set_datarUs   r�test_no_set_dataz*SourceLoaderBytecodeTests.test_no_set_dataOs����
�
��
�!� �K�K�1�1�5�5�7��:�C�C��	H����%�%�)�)�+�A�.�7��+�+�.�.�t�y�y�9�K����[�)�6G�D�K�K�!�!�%�%�'��*�3��6G�D�K�K�!�!�%�%�'��*�3�s
�AC�.C=c���d�}|jd��|t�|j_|jj	|j
�}|j
|�y)Nc����fd�}|S)Nc�����r@r&)r�rH�excs  �r�closurezcSourceLoaderBytecodeTests.test_set_data_raises_exceptions.<locals>.raise_exception.<locals>.closure]s����	rr&)r�r�s` r�raise_exceptionzRSourceLoaderBytecodeTests.test_set_data_raises_exceptions.<locals>.raise_exception\s
���
��Nrr�r�)r�NotImplementedErrorr�r]r
rFru)rr�rUs   r�test_set_data_raises_exceptionsz9SourceLoaderBytecodeTests.test_set_data_raises_exceptionsZsO��	�
	
�
�
��
�!�.�/B�C������k�k�*�*�4�9�9�5������%r)
r"r#r$r%rur�r�r�r�r�r�r�r�r�s@rr�r�
s8����<A�	L�&�
=�
0�=�	,�	H�
&rr�)rrric�"�eZdZdZd�Zd�Zd�Zy)�SourceLoaderGetSourceTestsz2Tests for importlib.abc.SourceLoader.get_source().c��d}|jd�}d}|jd�|_|j|�}|j	||�y)Nr~�mod.fileux = "ü"ry��SourceOnlyLoaderMockr�r�r�r��rrFrr�r�s     r�test_default_encodingz0SourceLoaderGetSourceTests.test_default_encodingqsL�����(�(��4�����m�m�G�,���)�$�/�/�$�/������&�1rc��d}|jd�}d}|jd�|_|j|�}|j	||�y)Nr~r�u# coding: Latin-1
x='ü'r�r�r�s     r�test_decoded_sourcez.SourceLoaderGetSourceTests.test_decoded_sourcezsL�����(�(��4��,���m�m�I�.���)�$�/�/�$�/������&�1rc���d}|jd�}d}|jd�|_tjdd�j|�}|j
|j|�|�y)Nr~r�zx = 42
y = -13
ryT)r�r�r��io�IncrementalNewlineDecoderr|r�r�)rrFrr��expects     r�test_universal_newlinesz2SourceLoaderGetSourceTests.test_universal_newlines�sd�����(�(��4��(���m�m�G�,����-�-�d�D�9�@�@��H����������.��7rN)r"r#r$r%r�r�r�r&rrr�r�ms��<�2�2�8rr�)r��__main__)NF)cr�rOrfr��test.supportrrv�unittestrrx�test.test_importlibrrB�import_importlibrr
rrr(�	test_both�%Frozen_MetaPathFinderInheritanceTests�%Source_MetaPathFinderInheritanceTestsr/�&Frozen_PathEntryFinderInheritanceTests�&Source_PathEntryFinderInheritanceTestsr2�%Frozen_ResourceLoaderInheritanceTests�%Source_ResourceLoaderInheritanceTestsr5�$Frozen_InspectLoaderInheritanceTests�$Source_InspectLoaderInheritanceTestsr8�&Frozen_ExecutionLoaderInheritanceTests�&Source_ExecutionLoaderInheritanceTestsr:�!Frozen_FileLoaderInheritanceTests�!Source_FileLoaderInheritanceTestsr>�#Frozen_SourceLoaderInheritanceTests�#Source_SourceLoaderInheritanceTestsrMrOrY�Frozen_MPFDefaultTests�Source_MPFDefaultTestsrb�Frozen_PEFDefaultTests�Source_PEFDefaultTestsr3rf�Frozen_LDefaultTests�SourceLDefaultTestsr��Frozen_RLDefaultTests�Source_RLDefaultTestsr�r��Frozen_ILDefaultTests�Source_ILDefaultTestsr�r��Frozen_ELDefaultTests�Source_ELDefaultsTestsr�r��Frozen_MPFFindModuleTests�Source_MPFFindModuleTestsr��Frozen_LoaderLoadModuleTests�Source_LoaderLoadModuleTestsr��Frozen_ILSourceToCodeTests�Source_ILSourceToCodeTestsr�Frozen_ILGetCodeTests�Source_ILGetCodeTestsr�Frozen_ILLoadModuleTests�Source_ILLoadModuleTestsr,�Frozen_ELGetCodeTests�Source_ELGetCodeTestsr<�	SPLIT_SOL�SPLIT_SLr_rw�Frozen_SourceOnlyLoaderTests�Source_SourceOnlyLoaderTests�skipIfr�r��Frozen_SLBytecodeTests�SourceSLBytecodeTestsr��%Frozen_SourceOnlyLoaderGetSourceTests�%Source_SourceOnlyLoaderGetSourceTestsr"�mainr&rr�<module>r�sV��	��	�
�&�����1�!�y�!�!�+�.�� �i� � ��1��&�I�&�&�'<�=�	�!�y�!�!�"2�3��!Q�!Q�H/�%�/��Y����S�1��&�&�$�&�$��Y����c�2��'�'�"�%�"��Y����S�1��&�&�R�$�R��Y����C�0��%�%�-�&�-��Y����c�2��'�'�B�!�B��Y�����-��"�"�*�#�*��Y����3�/��$�$�K���	�	�
%�.�%��Y���4�5����	�	�
%�>�%��Y���5�6����	�	�
'�.�'�0�Y���,�-����&�V�&�,�.�,��Y���4�5����,�F�,��}�-��
(��
(��Y���3�4����.�m�.���/��*�>�*��Y���3�4����1�1� !#�!#�L�Y���6�C�d�K����
,9�,9�b�Y���.�C�d�C����
'7�'7�X�Y���7�/7�9����
$�$�:�Y���2�/7�9����
*D�*D�^�Y���5�/7�"�"�$����6*�6*�v�Y���4�19�;������$
 � 0�.�A�	�#*�#�#*�L�|�$�T�B��##�##�LG2�3�G2�X�Y���.�T�%.�0����
�����(�(�*K�L�V&� 7�V&�M�V&�v�Y���2��D�%-�/����
8�8�F�Y���3�.7�9��&�&�
�z���H�M�M�O�r

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