
    Xj                     <   d dl Z d dlZd dlZd dlZddlmZ  G d dej        ej                  Z G d d          Z	 G d d	e	ej
        ej                  Z G d
 de	ej                  Z G d de	ej        ej                  Zedk    r ej                     dS dS )    N   )utilc                       e Zd Zd ZdS )CommonTestsc                     t          j        t          j        |                              |                    5  	 d d d            d S # 1 swxY w Y   d S )N)	resourcesas_filefilesjoinpath)selfpackagepaths      `/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/importlib_resources/tests/test_path.pyexecutezCommonTests.execute   s    yw77@@FFGG 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A		AAN)__name__
__module____qualname__r        r   r   r   
   s#            r   r   c                       e Zd Zd ZdS )	PathTestsc                 l   t          j        | j                  dz  }t          j        |          5 }t	          |t
          j                  sJ |j                            d          sJ t          |                      d|
                    d          k    sJ 	 ddd           dS # 1 swxY w Y   dS )zF
        Path should be readable and a pathlib.Path instance.
        
utf-8.filezHello, UTF-8 world!
zutf-8)encodingN)r   r
   datar	   
isinstancepathlibPathnameendswithrepr	read_textr   targetr   s      r   test_readingzPathTests.test_reading   s    ++l:v&& 	O$dGL111119%%l33??T$ZZ???*dnngn.N.NNNNNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	Os   A*B))B-0B-N)r   r   r   r%   r   r   r   r   r      s(        O O O O Or   r   c                       e Zd Zd ZdS )PathDiskTestsc                     t          j        | j                  dz  }t          j        |          5 }dt	          |          v sJ 	 ddd           dS # 1 swxY w Y   dS )z
        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_pathzPathDiskTests.test_natural_path   s     ++l:v&& 	'$SYY&&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's   AAAN)r   r   r   r*   r   r   r   r'   r'      s#        ' ' ' ' 'r   r'   c                       e Zd Zd ZdS )PathMemoryTestsc                     t          j        d          }|                     |j                   t	          j        |t          d                    | _        d | j        j        _	        d| j        j        _
        d S )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   r.   s     r   setUpzPathMemoryTests.setUp)   sp    z233
###'-.MNN
 
 
	 %)	!*/	'''r   N)r   r   r   r8   r   r   r   r,   r,   (   s#        0 0 0 0 0r   r,   c                       e Zd Zd ZdS )PathZipTestsc                     t          j        | j                  dz  }t          j        |          5 }|                                 ddd           dS # 1 swxY w Y   dS )z
        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_managerz+PathZipTests.test_remove_in_context_manager4   s    
 ++l:v&& 	$KKMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   AAAN)r   r   r   r=   r   r   r   r:   r:   3   s#            r   r:   __main__)r/   r   unittestimportlib_resourcesr    r   r   TestCaser   	DiskSetupr'   r,   ZipSetupr:   r   mainr   r   r   <module>rF      s[   				   ' ' ' '          $"H$5   	O 	O 	O 	O 	O 	O 	O 	O	' 	' 	' 	' 	'It~x/@ 	' 	' 	'0 0 0 0 0i!2 0 0 0    9dmX->    zHMOOOOO r   