
    <e              	       N   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
 d dlmZ d dlmZmZ 	 d dlmZ  eed            eed           n# eef$ r d dlZY nw xY wej        d             Zej        d	             Zej        d
             Zej        d             Z G d d          Z G d de          Z G d de          Zeeeeeeeeef         ef         f         ef         f         Z G d dee          Z  G d dee          Z! G d dee          Z" G d de          Z# G d dee          Z$ G d dee          Z% ej&                    fdZ' G d d           Z(d! Z) G d" d#          Z* e             G d$ d%                      Z+d& Z,dS )'    N)FS_NONASCII)requires_zlib)DictUnion)	resourcesfilesas_filec               #      K   t          j                    } 	 t          j        |           V  t	          j        |            d S # t	          j        |            w xY wN)tempfilemkdtemppathlibPathshutilrmtree)tmpdirs    3/usr/lib/python3.11/test/test_importlib/fixtures.pytempdirr      s[      Fl6"""""ffs   A Ac               #      K   t          j                    } 	 d V  t          j        |            d S # t          j        |            w xY wr   )osgetcwdchdir)origs    r   save_cwdr   !   sB      9;;D
s	   1 Ac               #      K   t                      5 } t                      5  t          j        t	          |                      | V  d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S r   )r   r   r   r   str)tmps    r   tempdir_as_cwdr   *   s      	 cZZ 	 	HSXXIII	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                 s4   A*&AA*A	A*A	A**A.1A.c              #      K   t           j                            |            	 d V  t           j                            |            d S # t           j                            |            w xY wr   )sys	meta_pathappendremove)finders    r   install_finderr%   2   sb      M   %V$$$$$V$$$$s   A !A)c                       e Zd Zd ZdS )Fixturesc                 t    t          j                    | _        |                     | j        j                   d S r   )
contextlib	ExitStackfixtures
addCleanupcloseselfs    r   setUpzFixtures.setUp<   s/    ",..+,,,,,    N)__name__
__module____qualname__r0    r1   r   r'   r'   ;   s#        - - - - -r1   r'   c                        e Zd Z fdZ xZS )SiteDirc                     t                                                       | j                            t	                                | _        d S r   )superr0   r+   enter_contextr   site_dirr/   	__class__s    r   r0   zSiteDir.setUpB   s3    33GII>>r1   r2   r3   r4   r0   __classcell__r=   s   @r   r7   r7   A   s8        ? ? ? ? ? ? ? ? ?r1   r7   c                   N     e Zd Zeej        d                         Z fdZ xZS )	OnSysPathc              #     K   t          |           gt          j        d d<   	 d V  t          j                            t          |                      d S # t          j                            t          |                      w xY wNr   )r   r    pathr#   )dirs    r   add_sys_pathzOnSysPath.add_sys_pathH   sm       Cz!	&EEEHOOCHH%%%%%CHOOCHH%%%%s   A .Bc                     t                                                       | j                            |                     | j                             d S r   )r9   r0   r+   r:   rG   r;   r<   s    r   r0   zOnSysPath.setUpQ   s@    ##D$5$5dm$D$DEEEEEr1   )	r2   r3   r4   staticmethodr)   contextmanagerrG   r0   r?   r@   s   @r   rB   rB   G   sh        & &  \&F F F F F F F F Fr1   rB   c                   B     e Zd ZU ddddddZeed<    fdZd	 Z xZS )
DistInfoPkgaL  
                Name: distinfo-pkg
                Author: Steven Ma
                Version: 1.0.0
                Requires-Dist: wheel >= 1.0
                Requires-Dist: pytest; extra == 'test'
                Keywords: sample package

                Once upon a time
                There was a distinfo pkg
                zmod.py,sha256=abc,20
zi
                [entries]
                main = mod:main
                ns:sub = mod:main
            )METADATARECORDentry_points.txtJ
            def main():
                print("hello world")
            )distinfo_pkg-1.0.0.dist-infomod.pyr   c                     t                                                       t          t          j        | j                   d S r   r9   r0   build_filesrL   r   r;   r<   s    r   r0   zDistInfoPkg.setUpv   /    K%t}55555r1   c                     	 t          j        | j        dz             t          j        t
          j                  }|d         }|d                                         |d<   t          || j                   d S )NrQ   rM   )	r   r   r;   copydeepcopyrL   r   upperrU   )r/   r   infos      r   make_uppercasezDistInfoPkg.make_uppercasez   sq    	 	dm&DDEEEk/0034
+1133ZE4=)))))r1   )	r2   r3   r4   r   FilesDef__annotations__r0   r\   r?   r@   s   @r   rL   rL   [   s         
 /!)
 )
&) E8   46 6 6 6 6* * * * * * *r1   rL   c                   6     e Zd ZU dddiiZeed<    fdZ xZS )DistInfoPkgWithDotzpkg_dot-1.0.0.dist-inforM   N
                Name: pkg.dot
                Version: 1.0.0
                r   c                     t                                                       t          t          j        | j                   d S r   )r9   r0   rU   r`   r   r;   r<   s    r   r0   zDistInfoPkgWithDot.setUp   s0    &,dm<<<<<r1   r2   r3   r4   r   r]   r^   r0   r?   r@   s   @r   r`   r`      sb         ! $
E8   = = = = = = = = =r1   r`   c                   <     e Zd ZU ddiddidZeed<    fdZ xZS )DistInfoPkgWithDotLegacyrM   ra   zN
                Name: pkg.lot
                Version: 1.0.0
                )zpkg.dot-1.0.0.dist-infozpkg.lot.egg-infor   c                     t                                                       t          t          j        | j                   d S r   )r9   r0   rU   re   r   r;   r<   s    r   r0   zDistInfoPkgWithDotLegacy.setUp   s0    ,2DMBBBBBr1   rc   r@   s   @r   re   re      s~           $
  
 E8   C C C C C C C C Cr1   re   c                        e Zd Z fdZ xZS )DistInfoPkgOffPathc                     t                                                       t          t          j        | j                   d S r   rT   r<   s    r   r0   zDistInfoPkgOffPath.setUp   rV   r1   r>   r@   s   @r   rh   rh      s8        6 6 6 6 6 6 6 6 6r1   rh   c                   @     e Zd ZU ddddddddZeed	<    fd
Z xZS )
EggInfoPkga  
                Name: egginfo-pkg
                Author: Steven Ma
                License: Unknown
                Version: 1.0.0
                Classifier: Intended Audience :: Developers
                Classifier: Topic :: Software Development :: Libraries
                Keywords: sample package
                Description: Once upon a time
                        There was an egginfo package
                zW
                mod.py
                egginfo_pkg.egg-info/top_level.txt
            zG
                [entries]
                main = mod:main
            zq
                wheel >= 1.0; python_version >= "2.7"
                [test]
                pytest
            zmod
)zPKG-INFOzSOURCES.txtrO   zrequires.txtztop_level.txtrP   )zegginfo_pkg.egg-inforR   r   c                     t                                                       t          t          j        | j                   d S Nprefix)r9   r0   rU   rk   r   r;   r<   s    r   r0   zEggInfoPkg.setUp   s2    J$T];;;;;;r1   rc   r@   s   @r   rk   rk      s         
!
 %3!
 !
69   E8      D< < < < < < < < <r1   rk   c                   2     e Zd ZU ddiZeed<    fdZ xZS )EggInfoFilezegginfo_file.egg-infoaa  
            Metadata-Version: 1.0
            Name: egginfo_file
            Version: 0.1
            Summary: An example package
            Home-page: www.example.com
            Author: Eric Haffa-Vee
            Author-email: eric@example.coms
            License: UNKNOWN
            Description: UNKNOWN
            Platform: UNKNOWN
            r   c                     t                                                       t          t          j        | j                   d S rm   )r9   r0   rU   rq   r   r;   r<   s    r   r0   zEggInfoFile.setUp   s2    K%dm<<<<<<r1   rc   r@   s   @r   rq   rq      sZ          "E8   = = = = = = = = =r1   rq   c                    	 |                                  D ]\  }}||z  }t          |t                    r&|                                 t	          ||           Et          |t
                    rC|                    d          5 }|                    |           d d d            n# 1 swxY w Y   |                    dd          5 }|                    t          |                     d d d            n# 1 swxY w Y   d S )Nrn   wbwzutf-8)encoding)	items
isinstancedictmkdirrU   bytesopenwriteDALS)	file_defsro   namecontents	full_namefs         r   rU   rU      s}   & $//++ , ,hTM	h%% 		,OO33333(E** ,^^D)) &QGGH%%%& & & & & & & & & & & & & & & ^^C'^:: ,aGGDNN+++, , , , , , , , , , , , , , ,, ,s$   B''B+	.B+	
#C99C=	 C=	c                       e Zd Zd ZdS )FileBuilderc                 :    t           p|                     d          S )Nz'File system does not support non-ascii.)r   skipr.   s    r   unicode_filenamezFileBuilder.unicode_filename  s    Rdii(QRRRr1   N)r2   r3   r4   r   r5   r1   r   r   r     s(        S S S S Sr1   r   c                 P    	 t          j        |                                           S r   )textwrapdedentlstrip)r   s    r   r~   r~     s!    ?3&&(((r1   c                       e Zd Zd ZdS )
NullFinderc                     d S r   r5   )r/   r   s     r   find_modulezNullFinder.find_module  s    r1   N)r2   r3   r4   r   r5   r1   r   r   r     s#            r1   r   c                       e Zd ZdZd Zd ZdS )ZipFixturesztest.test_importlib.datac                 d   t          j        | j                                      |          }| j                             t          j        |                    }t          j                            dt          |                     | j         
                    t          j        j        d           d S rD   )r   r   rootjoinpathr:   r	   r    rE   insertr   callbackpop)r/   filenamepkg_filefiles       r   _fixture_on_pathzZipFixtures._fixture_on_path!  s    ?49--66x@@~++I,=h,G,GHH3t99%%%a00000r1   c                 t    t          j                    | _        |                     | j        j                   d S r   )r)   r*   r   r,   r-   r.   s    r   r0   zZipFixtures.setUp(  s/    #-//,-----r1   N)r2   r3   r4   r   r   r0   r5   r1   r   r   r     s7        %D1 1 1. . . . .r1   r   c                       	  fd}|S )Nc                 J     t          j                    fd            }|S )Nc                 n    D ]0} | j         di |5   | fi | d d d            n# 1 swxY w Y   1d S )Nr5   )subTest)r/   argsargs_setfuncs     r   _innerz-parameterize.<locals>.wrapper.<locals>._inner2  s      ' '!T\))D)) ' 'D&&&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' '' 's   
)-	-	)	functoolswraps)r   r   r   s   ` r   wrapperzparameterize.<locals>.wrapper1  s>    				' 	' 	' 	' 	' 
		'
 r1   r5   )r   r   s   ` r   parameterizer   .  s&    6     Nr1   )-r   r    rX   r   r   r   r   r   r)   test.support.os_helperr   test.supportr   typingr   r   	importlibr   getattrImportErrorAttributeErrorimportlib_resourcesrJ   r   r   r   r%   r'   r7   rB   r   r]   rL   r`   re   rh   rk   rq   r   rU   r   r~   r   r   r   r5   r1   r   <module>r      s+   				 



              . . . . . . & & & & & &        ,######GIwGIy!!!!^$ , , ,++++++,          % % %- - - - - - - -? ? ? ? ?h ? ? ?F F F F F F F F" U4U4S>3+>%? ?@#EFFG'* '* '* '* '*)W '* '* '*T= = = = =G = = =C C C C Cy' C C C*6 6 6 6 6 6 6 6%< %< %< %< %<G %< %< %<P= = = = =)W = = =* #/',.. , , , ,DS S S S S S S S
) ) )
       
 . . . . . . . .     s   A A'&A'