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_main.cpython-312.opt-1.pyc

�

)Μg
7�
��ddlZddlZddlZddlZddlZddlZddlZ	ddlm	Z
ddl
mZddlmZddlmZmZmZmZmZmZmZmZmZej4d��ZGd�d	ej8ej:�ZGd
�dej8ej:�ZGd�d
ej@ejBej:�Z"Gd�dej@ejBej:�Z#Gd�dejHejJejLejNej8ej:�Z(Gd�dej@ejBej:�Z)Gd�dej@ej:�Z*Gd�dej@e
j:�Z+Gd�dej:�Z,Gd�dej@ejBejZej:�Z.Gd�dej^ej:�Z0Gd�dej@ejBej:�Z1Gd �d!ejHejJejLejNej:�Z2y#e$r
ddlm	Z
Y��gwxYw)"�N�)�fake_filesystem_unittest)�fixtures)�suppress)	�Distribution�
EntryPoint�PackageNotFoundError�_unique�
distributions�entry_points�metadata�packages_distributions�versionc#�K�tjd��5}tjdt��|��ddd�y#1swYyxYw�w)NT)�record�default)�category)�warnings�catch_warnings�simplefilter�DeprecationWarning)�ctxs �:/usr/local/lib/python3.12/test/test_importlib/test_main.py�suppress_known_deprecationrs7����	�	 �	 ��	-�����i�2D�E��	�
.�	-�	-�s�A� A�	A�A�Ac��eZdZdZd�Zd�Zd�Zee�e	�d���Z
eje
d��e
d���d	��Zy)
�
BasicTestsz\d+\.\d+(\.\d)?c�.�tjd�}y)Nzdistinfo-pkg)r�	from_name)�self�dists  r�test_retrieves_version_of_selfz)BasicTests.test_retrieves_version_of_self's���%�%�n�5��c��|jt�5tjd�ddd�y#1swYyxYw)N�does-not-exist��assertRaisesr	rr�rs r�test_for_name_does_not_existz'BasicTests.test_for_name_does_not_exist,s,��
�
�
�3�
4��"�"�#3�4�5�
4�
4���5�>c��|jt�5}tjd�ddd�y#1swYyxYw)z�
        When a package is not found, that could indicate that the
        package is not installed or that it is installed without
        metadata. Ensure the exception mentions metadata to help
        guide users toward the cause. See #124.
        r$Nr%)rrs  r�(test_package_not_found_mentions_metadataz3BasicTests.test_package_not_found_mentions_metadata0s0���
�
�3�
4���"�"�#3�4�5�
4�
4�r)c��|jt�5tdtfi��ddd�y#1swYyxYw)N�DistributionSubclass)r&�	TypeError�typerr's r�test_abc_enforcedzBasicTests.test_abc_enforced=s2���
�
�y�
)�=�D�'�,��"�=�?�*�
)�
)�s	�7�AN��name�c��|jt�5tj|�ddd�y#1swYyxYw�N)r&�
ValueErrorrr)rr2s  r� test_invalid_inputs_to_from_namez+BasicTests.test_invalid_inputs_to_from_nameCs,��
�
�
�z�
*��"�"�4�(�+�
*�
*�r))�__name__�
__module__�__qualname__�version_patternr!r(r+r�AssertionErrorrr0r�parameterize�dictr7�r"rrr$sk��(�O�<�
5�
0��n���!�@�"��@��X����$���"�
��)�	�)r"rc�$�eZdZd�Zd�Zd�Zd�Zy)�ImportTestsc��|jt�5tjd�ddd�y#1swYyxYw)N�does_not_exist)r&�ImportError�	importlib�
import_moduler's r�test_import_nonexistent_modulez*ImportTests.test_import_nonexistent_moduleMs-���
�
�{�
+��#�#�$4�5�,�
+�
+�r)c�v�td��d}|j|j�jd�y)N�entries��group�main)r�assertEqual�loadr8�r�eps  r�test_resolvezImportTests.test_resolveSs-��
�	�
*�6�
2���������+�+�V�4r"c�Z�td��d}|j|jd�y)NrIrJzns:subzmod:main)rrM�valuerOs  r�"test_entrypoint_with_colon_in_namez.ImportTests.test_entrypoint_with_colon_in_nameWs%��
�	�
*�8�
4��������:�.r"c� �tddd��}y)NrPzimportlib.metadata�grp�r2rSrK�rrOs  r�test_resolve_without_attrz%ImportTests.test_resolve_without_attr[s��
��&��
�r"N)r8r9r:rGrQrTrYr?r"rrArALs��6�5�/�/r"rAc�.�eZdZed��Zd�Zd�Zd�Zy)�NameNormalizationTestsc��|�d�ddiiS)zu
        Create minimal metadata for a dist-info package with
        the indicated name on the file system.
        z
.dist-info�METADATAz
VERSION: 1.0
r?r1s r�make_pkgzNameNormalizationTests.make_pkges#���f�J���,�"�
�	
r"c�b�tj|jd�|j�y)z�
        For a package with a dash in the name, the dist-info metadata
        uses underscores in the name. Ensure the metadata loads.
        �my_pkgN�r�build_filesr^�site_dirr's r�-test_dashes_in_dist_name_found_as_underscoreszDNameNormalizationTests.test_dashes_in_dist_name_found_as_underscoresqs!��
	���T�]�]�8�4�d�m�m�Dr"c�f�d}tj|j|�|j�y)zG
        Ensure the metadata loads when queried with any case.
        �CherryPyNra)r�pkg_names  r� test_dist_name_found_as_any_casez7NameNormalizationTests.test_dist_name_found_as_any_caseys&�������T�]�]�8�4�d�m�m�Dr"c���tj|jd�|j�t	tt
���}|jjtj��}|jj|j|��tj|jd�|�t	tt
���}y)z~
        Two distributions varying only by non-normalized name on
        the file system should resolve as the same.
        �abc�ABCN)
rrbr^rc�listr
r�
enter_context�tempdir�add_sys_path)r�before�alt_site_dir�afters    r�test_unique_distributionsz0NameNormalizationTests.test_unique_distributions�s���
	���T�]�]�5�1�4�=�=�A��g�m�o�.�/���}�}�2�2�8�3C�3C�3E�F���
�
�#�#�D�$5�$5�l�$C�D����T�]�]�5�1�<�@��W�]�_�-�.�r"N)r8r9r:�staticmethodr^rdrhrsr?r"rr[r[ds#���	
��	
�*�2�
)r"r[c�8�eZdZed��Zed��Zd�Zd�Zy)�
NonASCIITestsc�<�dddii}tj||�y)zb
        Create minimal metadata for a package with non-ASCII in
        the description.
        �portend.dist-infor]uDescription: pôrˈtend�portend�rrb�rc�contentss  r�pkg_with_non_ascii_descriptionz,NonASCIITests.pkg_with_non_ascii_description�s.��
 ��5�"�
��
	���X�x�0�r"c�<�dddii}tj||�y)zl
        Create minimal metadata for an egg-info package with
        non-ASCII in the description.
        rxr]u:
                Name: portend

                pôrˈtendryrzr{s  r�'pkg_with_non_ascii_description_egg_infoz5NonASCIITests.pkg_with_non_ascii_description_egg_info�s0��
 ���"�
��	���X�x�0�r"c�P�|j|j�}t|�}yr5)r}rcr
�rrg�metas   r�test_metadata_loadsz!NonASCIITests.test_metadata_loads�s ���6�6�t�}�}�E����!�r"c�P�|j|j�}t|�}yr5)rrcr
r�s   r�test_metadata_loads_egg_infoz*NonASCIITests.test_metadata_loads_egg_info�s ���?�?��
�
�N����!�r"N)r8r9r:rtr}rr�r�r?r"rrvrv�s2���������� 3�
3r"rvc��eZdZd�Zd�Zy)�DiscoveryTestsc�*�tt��}yr5)rlr)r�distss  r�test_package_discoveryz%DiscoveryTests.test_package_discovery�s���]�_�%�r"c��|jt�5ttdd���ddd�y#1swYyxYw)N�	something�else)�contextr2)r&r6rlrr's r�test_invalid_usagez!DiscoveryTests.test_invalid_usage�s+��
�
�
�z�
*���{��@�A�+�
*�
*�s�6�?N)r8r9r:r�r�r?r"rr�r��s��N�Br"r�c��eZdZd�Zd�Zy)�
DirectoryTestc��|jjd�j�|jt�5td�ddd�y#1swYyxYw)NzEGG-INFOzunknown-package)rc�joinpath�mkdirr&r	rr's r�
test_egg_infozDirectoryTest.test_egg_info�sA���
�
���z�*�0�0�2�
�
�
�3�
4��%�&�5�
4�
4�s�A�Ac��|jjd�}|j�|j|�5|j	t
�5t
d�ddd�ddd�y#1swY�xYw#1swYyxYw)Nzfoo-3.6.egg�foo)rcr�r�ror&r	r)r�eggs  r�test_eggzDirectoryTest.test_egg�s`���m�m�$�$�]�3���	�	��
�
�
�s�
#��"�"�#7�8����9�$�
#�8�8��$�
#�s#�A<�A0�A<�0A9	�5A<�<BN)r8r9r:r�r�r?r"rr�r��s��'�r"r�c��eZdZdZd�Zy)�MissingSysPathz/does-not-existc�@�tjj�y�zp
        Discovering distributions should succeed even if
        there is an invalid path on sys.path.
        N)rEr
rr's r�test_discoveryzMissingSysPath.test_discovery�s��
	���(�(�*r"N)r8r9r:rcr�r?r"rr�r��s�� �H�+r"r�c�(��eZdZdZ�fd�Zd�Z�xZS)�InaccessibleSysPathz/access-deniedc���t�|��|j�|jj	|j
d��y)Nr)�	perm_bits)�super�setUp�
setUpPyfakefs�fs�
create_dirrc)r�	__class__s �rr�zInaccessibleSysPath.setUp�s3���
��
�����������4�=�=�C��8r"c�R�ttjj��yr�)rlrEr
rr's rr�z"InaccessibleSysPath.test_discovery�s��
	
�Y�
�
�
-�
-�
/�0r")r8r9r:rcr�r��
__classcell__�r�s@rr�r��s����H�9�
1r"r�c�N��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Z�xZS)
�TestEntryPointsc�l��t�|�|�tjj	ddd��|_y)Nr2rSrKrW)r��__init__rEr
rrP)r�argsr�s  �rr�zTestEntryPoints.__init__s4���
���$���$�$�/�/��w�g�0�
��r"c�h�tjtj|j��}yr5)�pickle�loads�dumpsrP)r�reviveds  r�test_entry_point_pickleablez+TestEntryPoints.test_entry_point_pickleables���,�,�v�|�|�D�G�G�4�5�r"c��tddd�y)zH
        Capture legacy (namedtuple) construction, discouraged.
        r2rSrKNrXr's r�test_positional_argsz$TestEntryPoints.test_positional_args
s��	�6�7�G�,r"c�z�|jt�5d|j_ddd�y#1swYyxYw)zEntryPoints should be immutable�badactorN)r&�AttributeErrorrPr2r's r�test_immutablezTestEntryPoints.test_immutables'��
�
�
�~�
.�%�D�G�G�L�/�
.�
.�s�1�:c��yr5r?r's r�	test_reprzTestEntryPoints.test_repr��r"c�.�t|j�y)zEntryPoints should be hashableN)�hashrPr's r�
test_hashablezTestEntryPoints.test_hashables
���T�W�W�
r"c��yr5r?r's r�test_modulezTestEntryPoints.test_moduler�r"c��yr5r?r's r�	test_attrzTestEntryPoints.test_attr!r�r"c�N�ttddd��tddd��g�y)zK
        EntryPoint objects are sortable, but result is undefined.
        �b�valrKrW�aN)�sortedrr's r�
test_sortablezTestEntryPoints.test_sortable$s)��	���5��@���5��@�
�	
r")
r8r9r:r�r�r�r�r�r�r�r�r�r�r�s@rr�r��s0���
�"�-�&�
)�
�)�$�	
r"r�c��eZdZd�Zy)�
FileSystemc��tj|j�ii|j��t	t��y)zb
        Ensure a Unicode subdirectory of a directory on sys.path
        does not crash.
        ��prefixN)rrb�unicode_filenamercrlrr's r�test_unicode_dir_on_sys_pathz'FileSystem.test_unicode_dir_on_sys_path3s6��
	���
�
"�
"�
$�b�)��=�=�	
�	
�]�_�r"N)r8r9r:r�r?r"rr�r�0s��	r"r�c��eZdZd�Zd�Zy)�!PackagesDistributionsPrebuiltTestc�&�|jd�y)Nzexample-21.12-py3-none-any.whl��_fixture_on_pathr's r�#test_packages_distributions_examplezEPackagesDistributionsPrebuiltTest.test_packages_distributions_example@s�����>�?r"c�&�|jd�y)zT
        Test packages_distributions on a wheel built
        by trampolim.
        zexample2-1.0.0-py3-none-any.whlNr�r's r�$test_packages_distributions_example2zFPackagesDistributionsPrebuiltTest.test_packages_distributions_example2Ds��
	
���?�@r"N)r8r9r:r�r�r?r"rr�r�?s��B�Dr"r�c��eZdZd�Zd�Zy)�PackagesDistributionsTestc�b�tjdddii|j��t�y)zN
        Test a package built without 'top-level.txt' or a file list.
        ztrim_example-1.0.0.dist-infor]zS
                Name: trim_example
                Version: 1.0.0
                r�N)rrbrcrr's r�6test_packages_distributions_neither_toplevel_nor_fileszPPackagesDistributionsTest.test_packages_distributions_neither_toplevel_nor_filesPs8��	���.��!�1�
��=�=�
	
�	� r"c��tjj�}td��}d|i}t	|�D]3\}}|jd|�|��dd|��d|��did|��d	dd|��dii��5|j
t
j|��
�t
j||j��t�}tt|��D]}�y)
zW
        Test top-level modules detected on a package without 'top-level.txt'.
        zX
                Name: all_distributions
                Version: 1.0.0
                )r]z!all_distributions-1.0.0.dist-infozimportable-name r3�
in_namespace_�mod�in_package_z__init__.py)�RECORDr�N)
rE�	machinery�all_suffixesr>�	enumerate�updater�build_recordrbrcr�range�len)r�suffixesr
�files�i�suffixrs       r�,test_packages_distributions_all_module_typeszFPackagesDistributionsTest.test_packages_distributions_all_module_typesas����&�&�3�3�5����
��
0��
��#�8�,�I�A�v��L�L�&�q�c�&��2�B�#�A�3�'��f�X���*�"�!��%�%�r��f�X���(�	�
�-�	����x�4�4�U�;�<����U�4�=�=�9�.�0�
��s�8�}�%�A�%r"N)r8r9r:r�r�r?r"rr�r�Ms
��!�"%Nr"r�c��eZdZd�Zy)�PackagesDistributionsEggTestc�$��t���fd�}y)z�
        Test old-style egg packages with a variation of 'top_level.txt',
        'SOURCES.txt', and 'installed-files.txt', available.
        c�`���j�D��chc]\}}||vr|��
c}}Scc}}wr5)�items)�package_name�import_name�
package_namesrs   �r�import_names_from_packagezcPackagesDistributionsEggTest.test_packages_distributions_on_eggs.<locals>.import_names_from_package�sC���3F�-�2E�2E�2G��2G�.�K���=�0��2G��
��s�*N)r)rr�rs  @r�#test_packages_distributions_on_eggsz@PackagesDistributionsEggTest.test_packages_distributions_on_eggs�s���
/�0�
�	r"N)r8r9r:r�r?r"rr�r��s��Yr"r�)3�rer��unittestr�importlib.metadatarE�
contextlib�	itertools�!pyfakefs.fake_filesystem_unittestr�ffsrD�stubsr3r�_contextrrrr	r
rrr
rr�contextmanagerr�DistInfoPkg�TestCaserrA�	OnSysPath�SiteDirr[rv�
EggInfoPkg� EggInfoPkgPipInstalledNoToplevel�EggInfoPkgPipInstalledNoModules�EggInfoPkgSourcesFallbackr�r�r�r�r��FileBuilderr��ZipFixturesr�r�r�r?r"r�<module>rs5��	�
������7�3���
�
�
�������%)��%�%�x�'8�'8�%)�P/�(�&�&��(9�(9�/�0,)�X�/�/��1A�1A�8�CT�CT�,)�^(3�H�&�&��(8�(8�(�:K�:K�(3�VB�����-�-��,�,��&�&�������
B�,
�H�&�&��(8�(8�(�:K�:K�
� +�X�'�'��):�):�+�
1�(�,�,�c�l�l�
1� .
�h�'�'�.
�b�����(�(�(�*>�*>��@Q�@Q��D��(<�(<�h�>O�>O�D�9N�����(�(�(�*;�*;�9N�x"Y�����-�-��,�,��&�&����"Y��}�7�6�6�7�s�I=�=J�J

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