
    2i                     d   S SK r S SKrS SKrS SKrSSKJr   " S S\R                  \R                  5      r " S S5      r	 " S S	\	\R                  \R                  5      r " S
 S\	\R                  5      r " S S\	\R                  \R                  5      r\S:X  a  \R                   " 5         gg)    N   )utilc                       \ rS rSrS rSrg)CommonTests
   c                     [         R                  " [         R                  " U5      R                  U5      5          S S S 5        g ! , (       d  f       g = f)N)	resourcesas_filefilesjoinpath)selfpackagepaths      ]/home/james-whalen/.local/lib/python3.13/site-packages/importlib_resources/tests/test_path.pyexecuteCommonTests.execute   s4    yw7@@FG HGGs   A
A N)__name__
__module____qualname____firstlineno__r   __static_attributes__r       r   r   r   
   s    r   r   c                       \ rS rSrS rSrg)	PathTests   c                    [         R                  " U R                  5      S-  n[         R                  " U5       nU R	                  U[
        R                  5        U R                  UR                  R                  S5      [        U5      5        U R                  SUR                  SS95        SSS5        g! , (       d  f       g= f)z6
Path should be readable and a pathlib.Path instance.

utf-8.filezHello, UTF-8 world!
zutf-8)encodingN)r	   r   datar
   assertIsInstancepathlibPath
assertTruenameendswithreprassertEqual	read_textr   targetr   s      r   test_readingPathTests.test_reading   s     +l:v&$!!$5OODII..|<d4jI4dnngn6VW '&&s   A4B77
Cr   N)r   r   r   r   r,   r   r   r   r   r   r      s    Xr   r   c                       \ rS rSrS rSrg)PathDiskTests   c                     [         R                  " U R                  5      S-  n[         R                  " U5       nS[	        U5      ;   d   e SSS5        g! , (       d  f       g= f)zr
Guarantee the internal implementation detail that
file-system-backed resources do not get the tempdir
treatment.
r   r    N)r	   r   r    r
   strr*   s      r   test_natural_pathPathDiskTests.test_natural_path   sI     +l:v&$SY&&& '&&s   A
A$r   N)r   r   r   r   r3   r   r   r   r   r/   r/      s    'r   r/   c                       \ rS rSrS rSrg)PathMemoryTests(   c                    [         R                  " S5      nU R                  UR                  5        [        R
                  " U[        S5      S9U l        S U R                  R                  l	        SU R                  R                  l
        g )Ns   Hello, UTF-8 world!
zpackage exists only in memory)filer   F)ioBytesIO
addCleanupcloser   create_packageFileNotFoundErrorr    __spec__originhas_location)r   r9   s     r   setUpPathMemoryTests.setUp)   se    zz23

#''-.MN
	 %)		!*/		'r   )r    N)r   r   r   r   rC   r   r   r   r   r6   r6   (   s    0r   r6   c                       \ rS rSrS rSrg)PathZipTests3   c                     [         R                  " U R                  5      S-  n[         R                  " U5       nUR	                  5         SSS5        g! , (       d  f       g= f)zu
It is not an error if the file that was temporarily stashed on the
file system is removed inside the `with` stanza.
r   N)r	   r   r    r
   unlinkr*   s      r   test_remove_in_context_manager+PathZipTests.test_remove_in_context_manager4   s@    
 +l:v&$KKM '&&s   A
A"r   N)r   r   r   r   rJ   r   r   r   r   rF   rF   3   s    r   rF   __main__)r:   r"   unittestimportlib_resourcesr	    r   r   TestCaser   	DiskSetupr/   r6   ZipSetuprF   r   mainr   r   r   <module>rT      s    	   ' $""H$5$5 	X 	X	'It~~x/@/@ 	'0i!2!2 09dmmX->->  zMMO r   