o
    Uh                     @   sb   d dl Z dd Zdd ZG dd dZdd	 Zd
d Zdd Zdd Zdd Zdd Z	dd Z
dS )    Nc                  C   s   ddl m}  |  S )Nr   Index)pkginfo.indexr   r    r   l/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/pkginfo/tests/test_index.py_make_index   s   r   c                  C   s"   ddl m}  G dd d| }| S )Nr   )Distributionc                   @      e Zd ZdZdZdS )z&_make_dummy.<locals>.DummyDistributiondummy1.0N__name__
__module____qualname__nameversionr   r   r   r   DummyDistribution       r   )pkginfo.distributionr   )r   r   r   r   r   _make_dummy   s   r   c                   @   r	   )NotADistributionnot_a_distror   Nr   r   r   r   r   r      r   r   c                  C   sV   t  } t| dksJ t|  dksJ t|  dksJ t|  dks)J d S )Nr   )r   lenkeysvaluesitemsindexr   r   r   test_index_empty   s
   r   c                  C   s>   t  } tt | d  W d    d S 1 sw   Y  d S Nnonesuch)r   pytestraisesKeyErrorr   r   r   r   test_index___getitem___miss   s   
"r$   c                  C   sD   t  } t }tt | |d< W d    d S 1 sw   Y  d S )N	dummy-1.0)r   r   r!   r"   
ValueError)
not_a_distr   r   r   r   %test_index___setitem___value_not_dist"   s
   
"r(   c                  C   sD   t  } t }tt || d< W d    d S 1 sw   Y  d S r   )r   r   r!   r"   r&   r   r
   r   r   r   test_index___setitem___bad_key*   s
   
"r*   c                  C   s   t  } t }|| d< | d |u sJ t| dksJ t|  dks$J t|  d dks0J t|  dks:J t|  d |ksFJ t|  dksPJ t|  d d|fks^J d S Nr%      r   )r   r   r   r   listr   r   r)   r   r   r    test_index___setitem___valid_key1   s    r.   c                  C   sF   t  } t }tt | | W d    d S 1 sw   Y  d S )N)r   r   r!   r"   r&   addr)   r   r   r   test_index_add_not_dist@   s
   "r0   c                  C   s   t  } t }| | | d |u sJ t| dksJ t|  dks%J t|  d dks1J t|  dks;J t|  d |ksGJ t|  dksQJ t|  d d|fks_J d S r+   )r   r   r/   r   r   r-   r   r   r)   r   r   r   test_index_add_valid_distG   s   
 r1   )r!   r   r   r   r   r$   r(   r*   r.   r0   r1   r   r   r   r   <module>   s    	