o
    uvXj+  ã                   @   sŠ   d dl mZ d dlZd dlZd dlZddlmZ ddlmZm	Z	m
Z
 G dd„ dejejƒZG d	d
„ d
ejejƒZG dd„ dejejƒZdS )é    )Úunicode_literalsNé   )Úfixturesé   )Ú_compatÚversionÚDistributionc                   @   ó   e Zd Zdd„ ZdS )ÚIntegrationTestsc                 C   s0   dd„ }|dƒs
J ‚|dƒsJ ‚|dƒrJ ‚dS )z}
        Illustrate the recommended procedure to determine if
        a specified version of a package is installed.
        c                 S   s   t j | ¡}t|jƒ|jv S )N)Ú	packagingÚrequirementsÚRequirementr   ÚnameÚ	specifier)Úpackage_specÚreq© r   úf/var/www/html/myproject/venv/lib/python3.10/site-packages/importlib_metadata/tests/test_integration.pyÚis_installed   s   zBIntegrationTests.test_package_spec_installed.<locals>.is_installedzdistinfo-pkg==1.0zdistinfo-pkg>=1.0,<2.0zdistinfo-pkg<1.0Nr   )Úselfr   r   r   r   Útest_package_spec_installed   s   z,IntegrationTests.test_package_spec_installedN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r
      ó    r
   c                   @   r	   )ÚFinderTestsc                 C   s2   G dd„ dt jƒ}| j  t  |ƒ ¡¡ t ¡  d S )Nc                       s    e Zd ZdZ‡ fdd„Z‡  ZS )z@FinderTests.test_finder_without_module.<locals>.ModuleFreeFinderzB
            A finder without an __module__ attribute
            c                    s   |dkrt |ƒ‚tƒ  |¡S )Nr   )ÚAttributeErrorÚsuperÚ__getattribute__)r   r   ©Ú	__class__r   r   r   (   s   zQFinderTests.test_finder_without_module.<locals>.ModuleFreeFinder.__getattribute__)r   r   r   Ú__doc__r   Ú__classcell__r   r   r   r   ÚModuleFreeFinder$   s    r#   )r   Ú
NullFinderÚenter_contextÚinstall_finderr   Údisable_stdlib_finder)r   r#   r   r   r   Útest_finder_without_module#   s
   	
ÿz&FinderTests.test_finder_without_moduleN)r   r   r   r(   r   r   r   r   r   !   r   r   c                   @   r	   )ÚLocalProjectTestsc                 C   s,   t  ¡ }|jd dksJ ‚|jdksJ ‚d S )NÚNamez	local-pkgz2.0.1)r   Ú_localÚmetadatar   )r   Údistr   r   r   Útest_find_local3   s   z!LocalProjectTests.test_find_localN)r   r   r   r.   r   r   r   r   r)   2   s    r)   )Ú
__future__r   ÚunittestÚpackaging.requirementsr   Úpackaging.versionÚ r   r   r   r   ÚDistInfoPkgÚTestCaser
   ÚFixturesr   ÚLocalPackager)   r   r   r   r   Ú<module>   s   