B
    `>                 @   sR   d dl Zd dlm  mZ d dlZd dlmZ ej	j
dd Zej	j
dd ZdS )    N)pytest_plugin_helpersc          
      s(  dG dd d |  tjd fdd tj}|}|}d}||k}|std|fd	||fd
t ks~ttrt	tnd
t	|dt kstrt	ndt	|dt kstrt	ndt	|t	|d }dd|i }t
t|d } } } }}dS )z>True when the component is a pgwui.components entry point
    Zpgwui_examplec               @   s   e Zd Zdd ZdS )z4test_pgwui_entry_point_there.<locals>.MockEntryPointc             S   s
   || _ d S )N)module_name)selfr    r   ^/home/kop/projects/devel/pgwui/pgwui_develop/PGWUI_Develop/tests/test_pytest_plugin_helpers.py__init__'   s    z=test_pgwui_entry_point_there.<locals>.MockEntryPoint.__init__N)__name__
__module____qualname__r   r   r   r   r   MockEntryPoint&   s   r   iter_entry_pointsc                 s
    gS )Nr   )args)r   	test_namer   r   <lambda>,       z.test_pgwui_entry_point_there.<locals>.<lambda>T)is)zv%(py8)s
{%(py8)s = %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.pgwui_entry_point
}(%(py3)s)
}(%(py6)s)
} is %(py11)sr   r   )py0py2py3py5py6py8py11zassert %(py13)spy13N)setattrr   pkg_resourcespgwui_entry_point
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)monkeypatch@py_assert1@py_assert4@py_assert7@py_assert10@py_assert9@py_format12@py_format14r   )r   r   r   test_pgwui_entry_point_there    s             r-   c       
   
   C   s   |  tjddd  tj}d}||}d}||}d}||k}|std|fd||fdt kslttrvt	tndt	|t	|t	|t	|t	|t	|d	 }d
d|i }	t
t|	d } } } } } }}dS )zAFalse when the component is not pgwui.components entry point
    r   c              W   s   g S )Nr   )r   r   r   r   r   9   r   z2test_pgwui_entry_point_not_there.<locals>.<lambda>fooF)r   )zx%(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.pgwui_entry_point
}(%(py4)s)
}(%(py8)s)
} is %(py13)sr   )r   r   py4r   r   Zpy10r   zassert %(py15)spy15N)r   r   r   r   r   r   r   r    r!   r"   r#   r$   )
r%   r&   @py_assert3@py_assert5r(   r*   @py_assert12Z@py_assert11r,   @py_format16r   r   r    test_pgwui_entry_point_not_there3   s    
        n   r5   )builtinsr   _pytest.assertion.rewrite	assertionrewriter   pytestpgwui_developr   markunittestr-   r5   r   r   r   r   <module>   s
     