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/__pycache__/test_main.cpython-311.opt-1.pyc
�

��Vc*��D�ddlZddlZddlZddlZddlZddlZddlZ	ddlm	Z
n#e$r	ddlm	Z
YnwxYwddl
mZddlmZmZmZmZmZmZmZmZGd�dejej��ZGd�d	ejej��ZGd
�dejejej��ZGd�d
ejejej��ZGd�dejejej��Z Gd�dejejej��Z!Gd�dejej��Z"Gd�deje
j��Z#Gd�dej��Z$Gd�dejejej%ej��Z&Gd�dej'ej��Z(Gd�dejejej��Z)dS)�N�)�fake_filesystem_unittest)�fixtures)�Distribution�
EntryPoint�PackageNotFoundError�
distributions�entry_points�metadata�packages_distributions�versionc�*�eZdZdZd�Zd�Zd�Zd�ZdS)�
BasicTestsz\d+\.\d+(\.\d)?c�.�tjd��}dS)Nzdistinfo-pkg)r�	from_name)�self�dists  �1D:\Python311\Lib\test\test_importlib\test_main.py�test_retrieves_version_of_selfz)BasicTests.test_retrieves_version_of_selfs���%�n�5�5����c��|�t��5tjd��ddd��dS#1swxYwYdS)N�does-not-exist��assertRaisesrrr�rs r�test_for_name_does_not_existz'BasicTests.test_for_name_does_not_exist#s���
�
�
�3�
4�
4�	5�	5��"�#3�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5�	5�	5��=�A�Ac��|�t��5}tjd��ddd��dS#1swxYwYdS)z�
        When a package is not found, that could indicate that the
        packgae is not installed or that it is installed without
        metadata. Ensure the exception mentions metadata to help
        guide users toward the cause. See #124.
        rNr)r�ctxs  r�(test_package_not_found_mentions_metadataz3BasicTests.test_package_not_found_mentions_metadata's����
�
�3�
4�
4�	5���"�#3�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5�	5�	5rc�F�|�tt��dS�N)�assertIsInstancer�typers r�test_new_style_classesz!BasicTests.test_new_style_classes3s�����l�D�1�1�1�1�1rN)�__name__�
__module__�__qualname__�version_patternrrr r%�rrrrsU������(�O�<�<�<�
5�5�5�
0�
0�
0�2�2�2�2�2rrc�&�eZdZd�Zd�Zd�Zd�ZdS)�ImportTestsc��|�t��5tjd��ddd��dS#1swxYwYdS)N�does_not_exist)r�ImportError�	importlib�
import_modulers r�test_import_nonexistent_modulez*ImportTests.test_import_nonexistent_module8s����
�
�{�
+�
+�	6�	6��#�$4�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6rc��td���d}|�|���jd��dS)N�entries��group�main)r
�assertEqual�loadr&�r�eps  r�test_resolvezImportTests.test_resolve>s>��
�	�
*�
*�
*�6�
2����������+�V�4�4�4�4�4rc�h�td���d}|�|jd��dS)Nr4r5zns:subzmod:main)r
r8�valuer:s  r�"test_entrypoint_with_colon_in_namez.ImportTests.test_entrypoint_with_colon_in_nameBs5��
�	�
*�
*�
*�8�
4�������:�.�.�.�.�.rc�*�tddd���}dS)Nr;zimportlib.metadata�grp��namer>r6�rr:s  r�test_resolve_without_attrz%ImportTests.test_resolve_without_attrFs#��
��&��
�
�
���rN)r&r'r(r2r<r?rEr*rrr,r,7sP������6�6�6�5�5�5�/�/�/�/�/�/�/�/rr,c�F�eZdZed���Zd�Zed���Zd�ZdS)�NameNormalizationTestsc��|dz}|���|dz}|jdd���5}|�d��ddd��n#1swxYwYdS)	z
        Create minimal metadata for a package with dashes
        in the name (and thus underscores in the filename).
        zmy_pkg.dist-info�METADATA�w�utf-8��encoding�
Version: 1.0
Nzmy-pkg��mkdir�open�write��site_dir�metadata_dirr�strms    r�pkg_with_dashesz&NameNormalizationTests.pkg_with_dashesPs��� �"4�4���������*�,��
�X�]�3��
1�
1�
1�	)�T��J�J�'�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)��x��A�A�Ac�:�|�|j��}dS)z�
        For a package with a dash in the name, the dist-info metadata
        uses underscores in the name. Ensure the metadata loads.
        N)rWrT�r�pkg_names  r�-test_dashes_in_dist_name_found_as_underscoreszDNameNormalizationTests.test_dashes_in_dist_name_found_as_underscores]s��
�'�'��
�6�6���rc��|dz}|���|dz}|jdd���5}|�d��ddd��n#1swxYwYdS)	z\
        Create minimal metadata for a package with mixed case
        in the name.
        zCherryPy.dist-inforIrJrKrLrNN�CherryPyrOrSs    r�pkg_with_mixed_casez*NameNormalizationTests.pkg_with_mixed_casees��� �"6�6���������*�,��
�X�]�3��
1�
1�
1�	)�T��J�J�'�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)��zrXc�:�|�|j��}dS)zG
        Ensure the metadata loads when queried with any case.
        N)r_rTrZs  r� test_dist_name_found_as_any_casez7NameNormalizationTests.test_dist_name_found_as_any_casers���+�+�D�M�:�:���rN)r&r'r(�staticmethodrWr\r_rar*rrrGrGOsf�������
�
��\�
�*�*�*��
�
��\�
�2�2�2�2�2rrGc�F�eZdZed���Zed���Zd�Zd�ZdS)�
NonASCIITestsc��|dz}|���|dz}|jdd���5}|�d��ddd��n#1swxYwYdS)	zb
        Create minimal metadata for a package with non-ASCII in
        the description.
        �portend.dist-inforIrJrKrLuDescription: pôrˈtendN�portendrO�rTrUr�fps    r�pkg_with_non_ascii_descriptionz,NonASCIITests.pkg_with_non_ascii_description}s��� �"5�5���������*�,��
�X�]�3��
1�
1�
1�	0�R��H�H�.�/�/�/�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0����	0�	0�	0�	0��yrXc��|dz}|���|dz}|jdd���5}|�tjd�������ddd��n#1swxYwYdS)	zl
        Create minimal metadata for an egg-info package with
        non-ASCII in the description.
        rfrIrJrKrLuK
                Name: portend

                pôrˈtend
                Nrg)rPrQrR�textwrap�dedent�striprhs    r�'pkg_with_non_ascii_description_egg_infoz5NonASCIITests.pkg_with_non_ascii_description_egg_info�s��� �"5�5���������*�,��
�X�]�3��
1�
1�
1�		�R��H�H�������%�'�'�
�
�
�		�		�		�		�		�		�		�		�		�		�		����		�		�		�		��ys�:A7�7A;�>A;c�X�|�|j��}t|��}dSr")rjrTr�rr[�metas   r�test_metadata_loadsz!NonASCIITests.test_metadata_loads�s(���6�6�t�}�E�E����!�!���rc�X�|�|j��}t|��}dSr")rorTrrqs   r�test_metadata_loads_egg_infoz*NonASCIITests.test_metadata_loads_egg_info�s(���?�?��
�N�N����!�!���rN)r&r'r(rbrjrorsrur*rrrdrd|sf�������
�
��\�
�����\��(3�3�3�
3�3�3�3�3rrdc��eZdZd�Zd�ZdS)�DiscoveryTestsc�<�tt����}dSr")�listr	)r�distss  r�test_package_discoveryz%DiscoveryTests.test_package_discovery�s���]�_�_�%�%���rc��|�t��5ttdd�����ddd��dS#1swxYwYdS)N�	something�else)�contextrC)r�
ValueErrorryr	rs r�test_invalid_usagez!DiscoveryTests.test_invalid_usage�s���
�
�
�z�
*�
*�	B�	B���{��@�@�@�A�A�A�	B�	B�	B�	B�	B�	B�	B�	B�	B�	B�	B�	B����	B�	B�	B�	B�	B�	Bs�A�A�AN)r&r'r(r{r�r*rrrwrw�s:������N�N�N�B�B�B�B�Brrwc��eZdZd�Zd�ZdS)�
DirectoryTestc���|j�d�����|�t��5td��ddd��dS#1swxYwYdS)NzEGG-INFOzunknown-package)rT�joinpathrPrrr
rs r�
test_egg_infozDirectoryTest.test_egg_info�s����
���z�*�*�0�0�2�2�2�
�
�
�3�
4�
4�	'�	'��%�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	'�	's�A$�$A(�+A(c�@�|j�d��}|���|�|��5|�t
��5t
d��ddd��n#1swxYwYddd��dS#1swxYwYdS)Nzfoo-3.6.egg�foo)rTr�rP�add_sys_pathrrr
)r�eggs  r�test_eggzDirectoryTest.test_egg�s���m�$�$�]�3�3���	�	����
�
�
�s�
#�
#�	�	��"�"�#7�8�8�
�
������
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s6�B�A;�/B�;A?	�?B�A?	�B�B�BN)r&r'r(r�r�r*rrr�r��s2������'�'�'�����rr�c��eZdZdZd�ZdS)�MissingSysPathz/does-not-existc�B�tj���dS�zp
        Discovering distributions should succeed even if
        there is an invalid path on sys.path.
        N)r0rr	rs r�test_discoveryzMissingSysPath.test_discovery�s��
	��(�(�*�*�*�*�*rN)r&r'r(rTr�r*rrr�r��s(������ �H�+�+�+�+�+rr�c�(��eZdZdZ�fd�Zd�Z�xZS)�InaccessibleSysPathz/access-deniedc���t�����|���|j�|jd���dS)Nr)�	perm_bits)�super�setUp�
setUpPyfakefs�fs�
create_dirrT)r�	__class__s �rr�zInaccessibleSysPath.setUp�sI���
���
�
��������������4�=�C��8�8�8�8�8rc�\�ttj�����dSr�)ryr0rr	rs rr�z"InaccessibleSysPath.test_discovery�s'��
	
�Y�
�
-�
-�
/�
/�0�0�0�0�0r)r&r'r(rTr�r��
__classcell__�r�s@rr�r��sL��������H�9�9�9�9�9�
1�1�1�1�1�1�1rr�c�T��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Z�xZ
S)�TestEntryPointsc���t��j|�tj�ddd���|_dS)NrCr>r6rB)r��__init__r0rrr;)r�argsr�s  �rr�zTestEntryPoints.__init__�sA��������$����$�/�/��w�g�0�
�
����rc�\�tjtj|j����}dSr")�pickle�loads�dumpsr;)r�reviveds  r�test_entry_point_pickleablez+TestEntryPoints.test_entry_point_pickleable�s!���,�v�|�D�G�4�4�5�5���rc�(�tddd��dS)zH
        Capture legacy (namedtuple) construction, discouraged.
        rCr>r6NrDrs r�test_positional_argsz$TestEntryPoints.test_positional_args�s��	�6�7�G�,�,�,�,�,rc��|�t��5d|j_ddd��dS#1swxYwYdS)zEntryPoints should be immutable�badactorN)r�AttributeErrorr;rCrs r�test_immutablezTestEntryPoints.test_immutable�s���
�
�
�~�
.�
.�	&�	&�%�D�G�L�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�
5�9�9c��dSr"r*rs r�	test_reprzTestEntryPoints.test_repr�����rc�.�t|j��dS)zEntryPoints should be hashableN)�hashr;rs r�
test_hashablezTestEntryPoints.test_hashable�s���T�W�
�
�
�
�
rc��|�t��5tjd���5t	j|j��ddd��n#1swxYwYddd��dS#1swxYwYdS)zI
        json should not expect to be able to dump an EntryPoint
        T)�recordN)r�	Exception�warnings�catch_warnings�jsonr�r;rs r�test_json_dumpzTestEntryPoints.test_json_dumps����
�
�y�
)�
)�	$�	$��(��5�5�5�
$�
$��
�4�7�#�#�#�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$����
$�
$�
$�
$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	$�	$s4�A/�A�A/�A	�A/�A	�A/�/A3�6A3c��dSr"r*rs r�test_modulezTestEntryPoints.test_moduler�rc��dSr"r*rs r�	test_attrzTestEntryPoints.test_attrr�rc�h�ttddd���tddd���g��dS)zK
        EntryPoint objects are sortable, but result is undefined.
        �b�valr6rB�aN)�sortedrrs r�
test_sortablezTestEntryPoints.test_sortablesI��	���5��@�@�@���5��@�@�@�
�	
�	
�	
�	
�	
r)r&r'r(r�r�r�r�r�r�r�r�r�r�r�r�s@rr�r��s��������
�
�
�
�
�"�"�"�-�-�-�&�&�&�
)�)�)�
���$�$�$�)�)�)�$�$�$�	
�	
�	
�	
�	
�	
�	
rr�c��eZdZd�ZdS)�
FileSystemc��tj|���ii|j���t	t����dS)zb
        Ensure a Unicode subdirectory of a directory on sys.path
        does not crash.
        ��prefixN)r�build_files�unicode_filenamerTryr	rs r�test_unicode_dir_on_sys_pathz'FileSystem.test_unicode_dir_on_sys_pathsQ��
	��
�
"�
"�
$�
$�b�)��=�	
�	
�	
�	
�	
�]�_�_�����rN)r&r'r(r�r*rrr�r�s#������	�	�	�	�	rr�c��eZdZd�Zd�ZdS)�!PackagesDistributionsPrebuiltTestc�0�|�d��dS)Nzexample-21.12-py3-none-any.whl��_fixture_on_pathrs r�#test_packages_distributions_examplezEPackagesDistributionsPrebuiltTest.test_packages_distributions_example*s�����>�?�?�?�?�?rc�0�|�d��dS)zT
        Test packages_distributions on a wheel built
        by trampolim.
        zexample2-1.0.0-py3-none-any.whlNr�rs r�$test_packages_distributions_example2zFPackagesDistributionsPrebuiltTest.test_packages_distributions_example2.s��
	
���?�@�@�@�@�@rN)r&r'r(r�r�r*rrr�r�)s:������B�B�B�D�D�D�D�Drr�c��eZdZd�ZdS)�PackagesDistributionsTestc�`�tjdddii|j���t��dS)zN
        Test a package built without 'top-level.txt' or a file list.
        ztrim_example-1.0.0.dist-inforIzS
                Name: trim_example
                Version: 1.0.0
                r�N)rr�rTrrs r�6test_packages_distributions_neither_toplevel_nor_fileszPPackagesDistributionsTest.test_packages_distributions_neither_toplevel_nor_files:sN��	��.��!�1�
��=�
	
�
	
�
	
�
	
�	� � � � � rN)r&r'r(r�r*rrr�r�7s#������!�!�!�!�!rr�)*�rer�r�rl�unittestr��importlib.metadatar0�!pyfakefs.fake_filesystem_unittestr�ffsr/�stubs�rrrrr	r
rrr
�DistInfoPkg�TestCaserr,�	OnSysPath�SiteDirrGrd�
EggInfoPkgrwr�r�r�r��FileBuilderr��ZipFixturesr�r�r*rr�<module>r�s���	�	�	�	�����
�
�
�
�����������������7�3�3�3�3�3�3�3���7�7�7�6�6�6�6�6�6�6�6�7����������	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�2�2�2�2�2��%�x�'8�2�2�2�8/�/�/�/�/�(�&��(9�/�/�/�0*2�*2�*2�*2�*2�X�/��1A�8�CT�*2�*2�*2�Z+3�+3�+3�+3�+3�H�&��(8�(�:K�+3�+3�+3�\	B�	B�	B�	B�	B�X�(�(�*>��@Q�	B�	B�	B�
�
�
�
�
�H�&��(8�(�:K�
�
�
� +�+�+�+�+�X�'��):�+�+�+�
1�
1�
1�
1�
1�(�,�c�l�
1�
1�
1� 6
�6
�6
�6
�6
�h�'�6
�6
�6
�r��������(�(�*>��@Q����D�D�D�D�D��(<�h�>O�D�D�D�!�!�!�!�!����(�(�*;�!�!�!�!�!s�%�3�3