
    daf                         d dl Z d dlZddlmZ d dlmZmZmZmZm	Z	m
Z
  G d dej                  ej                        Z G d de      Zy)	    N   )fixtures)PackageNotFoundErrordistributiondistributionsentry_pointsfilesversionc                   H     e Zd Z fdZd Zd Zd Zd Zd Zd Z	d Z
 xZS )	TestZipc                 D    t         |           | j                  d       y )Nzexample-21.12-py3-none-any.whlsupersetUp_fixture_on_pathself	__class__s    7/root/Python-3.12.4/Lib/test/test_importlib/test_zip.pyr   zTestZip.setUp   s    >?    c                 :    | j                  t        d      d       y )Nexample21.12assertEqualr
   r   s    r   test_zip_versionzTestZip.test_zip_version       +W5r   c                 n    | j                  t              5  t        d       d d d        y # 1 sw Y   y xY w)Nzdefinitely-not-installed)assertRaisesr   r
   r   s    r   test_zip_version_does_not_matchz'TestZip.test_zip_version_does_not_match   s/    34 	0./	0 	0 	0s   +4c                     t        d      }|d   }| j                  |j                  d       |d   }| j                  |j                  d       y )Nconsole_scripts)groupr   zexample:mainExample)r   r   value)r   scriptsentry_points      r   test_zip_entry_pointszTestZip.test_zip_entry_points   sM    %67i(**N;i(**N;r   c                 V    | j                  t        d      j                  d             y )Nr   zdoes not exist)assertIsNoner   	read_textr   s    r   test_missing_metadatazTestZip.test_missing_metadata"   s!    ,y1;;<LMNr   c                 :    | j                  t        d      d       y )Nr%   r   r   r   s    r   test_case_insensitivezTestZip.test_case_insensitive%   r   r   c                     t        d      D ]1  }t        |j                  j                  |            }d|v r,J |        y )Nr   z.whl/r	   strdistlocate_filer   filepaths      r   
test_fileszTestZip.test_files(   @    )$ 	)Dtyy,,T23Dd?(D(?	)r   c                 p    t        t        t        j                  d d             }t	        |      dk(  sJ y )Nr   )r7   )listr   sysr7   len)r   distss     r   test_one_distributionzTestZip.test_one_distribution-   s+    ]!565zQr   )__name__
__module____qualname__r   r   r!   r)   r-   r/   r8   r?   __classcell__r   s   @r   r   r      s-    @60<O6)
r   r   c                   *     e Zd Z fdZd Zd Z xZS )TestEggc                 D    t         |           | j                  d       y )Nzexample-21.12-py3.6.eggr   r   s    r   r   zTestEgg.setUp3   s    78r   c                     t        d      D ]1  }t        |j                  j                  |            }d|v r,J |        y )Nr   z.egg/r1   r5   s      r   r8   zTestEgg.test_files7   r9   r   c                 <    t        d      }|j                  dk(  sJ y )Nr   )r   _normalized_name)r   r3   s     r   test_normalized_namezTestEgg.test_normalized_name<   s     I&$$	111r   )r@   rA   rB   r   r8   rK   rC   rD   s   @r   rF   rF   2   s    9)
2r   rF   )r<   unittest r   importlib.metadatar   r   r   r   r	   r
   ZipFixturesTestCaser   rF    r   r   <module>rR      s?    
    h""H$5$5  F2g 2r   