HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/test_importlib/source/__pycache__/test_finder.cpython-311.opt-2.pyc
�

��Vc"���ddlmZmZejd��ZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
Z
ddlZGd�dej��ZGd�de��Zejee�	��\ZZGd
�de��Zejee�	��\ZZGd�d
e��Zejee�	��\ZZedkre
j��dSdS)�)�abc�utilzimportlib.machineryN)�make_legacy_pycc��eZdZ	d�Zd�Zdddd�d�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zejejdkd��d���Zd�ZdS)�FinderTestsc��|jj|jjf|jj|jjfg}|jj|g|�R�S�N)�	machinery�SourceFileLoader�SOURCE_SUFFIXES�SourcelessFileLoader�BYTECODE_SUFFIXES�
FileFinder)�self�root�loader_detailss   �:D:\Python311\Lib\test\test_importlib\source\test_finder.py�
get_finderzFinderTests.get_finder(sR���>�:� �N�:�<��>�>� �N�<�>�?��)�t�~�(��?��?�?�?�?�c�\�|�|��}|�||d���S)NT��loader_only)r�_find)rr�module�finders    r�import_zFinderTests.import_/s+������&�&���z�z�&�&�d�z�;�;�;rN��compile_�unlinkc���	|�|h}tj|�5}|r|D]}tj||���|rb|D]_}t	j||��	t
||���3#t$r }|jtj	kr�Yd}~�Xd}~wwxYw|�
|d|��}|�t|d����|cddd��S#1swxYwYdS)N�.root�load_module)
r�create_modules�
py_compile�compile�osrr�OSError�errno�ENOENTr�
assertTrue�hasattr)	r�test�createrr�mapping�name�error�loaders	         r�run_testzFinderTests.run_test3s���	��	��V�F�
�
 �&�
)�	�W��
6�$�6�6�D��&�w�t�}�5�5�5�5��

"�"�	"�	"�D��I�g�d�m�,�,�,�"�'���
�6�6�6�6��"�"�"�"�!�;�%�,�6�"�!�"�"�"�"�"�����	"�����\�\�'�'�"2�D�9�9�F��O�O�G�F�M�:�:�;�;�;��#	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s=�AC(�A.�-C(�.
B�8B�C(�B�AC(�(C,�/C,c��|�d��|�ddhdh���|�ddh���dS)N�	top_levelr�r�r2�rs r�test_modulezFinderTests.test_modulePsZ���
�
�k�"�"�"��
�
�k�[�M�)�]�	�	,�	,�	,�	
�
�
�k�[�M�
�:�:�:�:�:rc��|�ddh��|�ddhdhdh���|�ddhdh���dS)N�pkg�pkg.__init__rr5r6r7s r�test_packagezFinderTests.test_packageZsl���
�
�e�n�-�.�.�.��
�
�e�n�-��8H�&�'�	�	)�	)�	)�	
�
�
�e�n�-��8H�
�I�I�I�I�Irc��tjdd��5}tj�|d��}|�|d��}|�t|d����ddd��dS#1swxYwYdS)Nr;�pkg.subr"�rr#r&�path�dirnamerr*r+)rr.�pkg_dirr1s    r�test_module_in_packagez"FinderTests.test_module_in_packageds���
�
 ���
;�
;�	<�w��g�o�o�g�n�&=�>�>�G��\�\�'�9�5�5�F��O�O�G�F�M�:�:�;�;�;�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�	<�	<s�AB�B�	Bc�"�tjdd��}|5}tj�|d��}|�|d��}|�t|d����ddd��dS#1swxYwYdS)Nr;zpkg.sub.__init__r>r"r?)r�contextr.rBr1s     r�test_package_in_packagez#FinderTests.test_package_in_packageks����%�n�6H�I�I��
�	<���g�o�o�g�n�&=�>�>�G��\�\�'�9�5�5�F��O�O�G�F�M�:�:�;�;�;�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�	<�	<s�AB�B�Bc��d}|�|d�|��|h��}|�d|�|����dS)N�_tempz{0}.__init__�__init__)r2�format�assertIn�get_filename)rr/r1s   r�test_package_over_modulez$FinderTests.test_package_over_modulessU�������t�n�&;�&;�D�&A�&A�4�%H�I�I���
�
�j�&�"5�"5�d�";�";�<�<�<�<�<rc���tjd��5}|�|dd��}|�|��ddd��dS#1swxYwYdS)N�blahr!�
sdfsadsadf)rr#r�assertIsNone)rr.�nothings   r�test_failurezFinderTests.test_failurexs���
�
 ��
(�
(�	'�G��l�l�7�7�#3�\�B�B�G����g�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	'�	's�2A�A�Ac��|j�d|jj|jjf��}t	ddd���5}|�d��ddd��n#1swxYwY	|�|dd�	��}|�t|d
����tj
d��dS#tj
d��wxYw)N�zmod.py�wzutf-8)�encodingz# test file for importlib�modTrr")r
rrr�open�writerr*r+r&r)rr�filer1s    r�test_empty_string_for_dirz%FinderTests.test_empty_string_for_dir}s
����*�*�2���0O��N�*�0,�-�-��
�(�C�'�
2�
2�
2�	4�d��J�J�2�3�3�3�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4����	4�	4�	4�	4�	 ��Z�Z���4�Z�@�@�F��O�O�G�F�M�:�:�;�;�;��I�h�������B�I�h�������s�A&�&A*�-A*�2;C�Cc���|j�d|jj|jjf��}d|_|���|�|jd��dS)NrU�*���)r
rrr�_path_mtime�invalidate_caches�assertEqual)rrs  r�test_invalidate_cachesz"FinderTests.test_invalidate_caches�sh����*�*�2���0O��N�*�0,�-�-������ � �"�"�"�����+�R�0�0�0�0�0rc�L�d}tj|��5}|�|d��}|�|dd���}|�|��ddd��n#1swxYwY|�|dd���}|�|��dS)NrXr!Tr)rr#rr�assertIsNotNonerQ)rrXr.r�founds     r�test_dir_removal_handlingz%FinderTests.test_dir_removal_handling�s�����
�
 ��
%�
%�	(���_�_�W�W�%5�6�6�F��J�J�v�u�$�J�?�?�E�� � ��'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(��
�
�6�5�d�
�;�;�����%� � � � � s�A	A,�,A0�3A0�win32z>os.chmod() does not support the needed arguments under Windowsc���tj��}|�|��tj|j��j}|�tj|j|��tj|jtj	tj
z��|�|j��}|�|d��}|�
||j��dS�N�doesnotexist)�tempfile�TemporaryDirectory�enterContextr&�statr/�st_mode�
addCleanup�chmod�S_IWUSR�S_IXUSRrrrb�	NOT_FOUND)r�tempdir�
original_moderrfs     r�test_no_read_directoryz"FinderTests.test_no_read_directory�s����-�/�/�����'�"�"�"�����-�-�5�
������'�,�
�>�>�>�
����t�|�d�l�:�;�;�;������.�.���
�
�6�>�2�2��������/�/�/�/�/rc���tj��5}|�|j��}|�|d��}|�||j��ddd��dS#1swxYwYdSrj)rl�NamedTemporaryFilerr/rrbru)r�file_objrrfs    r�test_ignore_filezFinderTests.test_ignore_file�s����
(�
*�
*�	4�h��_�_�X�]�3�3�F��J�J�v�~�6�6�E����U�D�N�3�3�3�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4����	4�	4�	4�	4�	4�	4s�AA-�-A1�4A1r	)�__name__�
__module__�__qualname__rrr2r8r<rCrFrMrSr\rcrg�unittest�
skipUnless�sys�platformrxr|�rrrrs2�������,@�@�@�<�<�<��d�4������:;�;�;�J�J�J�<�<�<�<�<�<�=�=�=�
'�'�'�

 �
 �
 �1�1�1�!�!�!��X�����0�L�N�N�0�0�N�N�0�4�4�4�4�4rrc��eZdZdZdd�ZdS)�FinderTestsPEP451NFc�B�|�|��}|�|jn|Sr	)�	find_specr1)rrr/r�specs     rrzFinderTestsPEP451._find�s&������%�%��"�8�t�{�{�D�8r�F�r}r~rrurr�rrr�r��s-�������I�9�9�9�9�9�9rr�)r
c��eZdZdgfZdd�ZdS)�FinderTestsPEP420NFc���tj��5tjdt��|�|��}|r|dn|cddd��S#1swxYwYdS)N�ignorer)�warnings�catch_warnings�simplefilter�DeprecationWarning�find_loader)rrr/r�loader_portionss     rrzFinderTestsPEP420._find�s���
�
$�
&�
&�	J�	J��!�(�,>�?�?�?�$�0�0��6�6�O�)4�I�?�1�%�%�/�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J����	J�	J�	J�	J�	J�	Js�;A�A �#A r�r�r�rrr�r��s7�������r�
�I�J�J�J�J�J�Jrr�c��eZdZdZdd�ZdS)�FinderTestsPEP302NFc��tj��5tjdt��|�|��cddd��S#1swxYwYdS)Nr�)r�r�r�r��find_module)rrr/rs    rrzFinderTestsPEP302._find�s���
�
$�
&�
&�	,�	,��!�(�,>�?�?�?��%�%�d�+�+�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	,�	,s�/A�A�Ar�r�r�rrr�r��s-�������I�,�,�,�,�,�,rr��__main__)�test.test_importlibrr�import_importlibr
r(r&r$ror�rl�test.support.import_helperrr�r�rr��	test_both�Frozen_FinderTestsPEP451�Source_FinderTestsPEP451r��Frozen_FinderTestsPEP420�Source_FinderTestsPEP420r��Frozen_FinderTestsPEP302�Source_FinderTestsPEP302r}�mainr�rr�<module>r�s���)�)�)�)�)�)�)�)�!�D�!�"7�8�8�	�����	�	�	�	���������
�
�
�
�����6�6�6�6�6�6���������a4�a4�a4�a4�a4�#�/�a4�a4�a4�H9�9�9�9�9��9�9�9��T�^�%��;�;�;����J�J�J�J�J��J�J�J��T�^�%��;�;�;����,�,�,�,�,��,�,�,��T�^�%��;�;�;�����z����H�M�O�O�O�O�O��r