U
    [e                     @   sR   d Z ddlmZ ddlmZ ddlmZ ddlmZ dd Z	G dd	 d	ej
ZdS )
zTests for the sphinx extension
    N)	extension)	sphinxext)utilsc                 C   s4   dd }||_ t| d| | d}t| ||d S )Nc                   S   s   d S )N r   r   r   `/var/www/html/services/stratfitenv/lib/python3.8/site-packages/stevedore/tests/test_sphinxext.pyinner   s    z_make_ext.<locals>.innerz{}_module:{}group)__doc__importlib_metadata
EntryPointformatr   	Extension)nameZ	docstringr   m1r   r   r   	_make_ext   s     
 r   c                       sD   e Zd Z fddZdd Zdd Zdd Zd	d
 Zdd Z  Z	S )TestSphinxExtc                    s8   t t|   tddtddg| _tj| j| _d S )Ntest1One-line docstringtest2"Multi-line docstring

Another para)	superr   setUpr   extsr   ExtensionManagermake_test_instanceem)self	__class__r   r   r   #   s
    zTestSphinxExt.setUpc                 C   s$   t t| j}| ddg| d S )N)z* test1 -- One-line docstringtest1_module)z* test2 -- Multi-line docstringtest2_module)listr   _simple_listr   assertEqualr   resultsr   r   r   test_simple_list+   s    zTestSphinxExt.test_simple_listc                 C   s8   t dd g}tj|}tt|}| dg| d S )Nnodoc)z* nodoc -- nodoc_module)r   r   r   r   r!   r   r"   r#   r   extr   r%   r   r   r   test_simple_list_no_docstring5   s    z+TestSphinxExt.test_simple_list_no_docstringc                 C   s4   t t| j}| ddddddddddg
| d S )	Nr   r   )-----r   
r   r   r   r   r    )r-   r    r/   r    r   r    r!   r   _detailed_listr   r#   r$   r   r   r   test_detailed_list@   s    z TestSphinxExt.test_detailed_listc                 C   s>   t tj| jddd}| dddddddddd	d
d	g| d S )N+)ZoverZunder)+++++r   r,   r.   r0   )r8   r    r1   r2   r3   r4   r$   r   r   r   test_detailed_list_formatR   s"    z'TestSphinxExt.test_detailed_list_formatc                 C   s@   t dd g}tj|}tt|}| dddddg| d S )Nr'   )r'   r(   )r-   r(   )r/   r(   )zC.. warning:: No documentation found for nodoc in nodoc_module:nodocr(   )r   r   r   r   r!   r   r5   r#   r)   r   r   r   test_detailed_list_no_docstringf   s    	z-TestSphinxExt.test_detailed_list_no_docstring)
__name__
__module____qualname__r   r&   r+   r6   r9   r:   __classcell__r   r   r   r   r   !   s   
r   )r	   importlib.metadatametadatar
   Z	stevedorer   r   Zstevedore.testsr   r   ZTestCaser   r   r   r   r   <module>   s   