U
    9vf                     @   s   d dl ZddlmZ ddlm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	ZG dd deZG dd deZG dd deZG dd deZG dd deZdS )    N   )BaseDiGraphTester)TestDiGraph)BaseGraphTester)	TestGraph)TestMultiDiGraph)TestMultiGraphc                     sx  G dd dt  G dd dt G dd dt G dd dt G d	d
 d
t tjtjtjtjfD ]} G  fddd| }| }t|j stt|j	st|
d t|j	d st| r
t|jstt|jstt|jd s
t|dd | rZt|j	d d s:tt|j	d d d srtqdt|j	d d sdtqdd S )Nc                   @   s   e Zd ZdS )ztest_factories.<locals>.mydict1N__name__
__module____qualname__ r   r   G/tmp/pip-unpacked-wheel-_lngutwb/networkx/classes/tests/test_special.pymydict1   s   r   c                   @   s   e Zd ZdS )ztest_factories.<locals>.mydict2Nr	   r   r   r   r   mydict2   s   r   c                   @   s   e Zd ZdS )ztest_factories.<locals>.mydict3Nr	   r   r   r   r   mydict3   s   r   c                   @   s   e Zd ZdS )ztest_factories.<locals>.mydict4Nr	   r   r   r   r   mydict4   s   r   c                   @   s   e Zd ZdS )ztest_factories.<locals>.mydict5Nr	   r   r   r   r   mydict5   s   r   c                       s    e Zd Z ZZZZZdS )ztest_factories.<locals>.MyGraphN)r
   r   r   Znode_dict_factoryZadjlist_outer_dict_factoryZadjlist_inner_dict_factoryZedge_key_dict_factoryedge_attr_dict_factoryr   r   r   r   r   r   r   r   MyGraph   s
   r   r      r   )dictnxGraphDiGraph
MultiGraphMultiDiGraph
isinstance_nodeAssertionError_adjadd_nodeZis_directed_pred_succZadd_edgeZis_multigraph)r   r   Gr   r   r   test_factories   s*    


 r&   c                   @   s   e Zd Zdd ZdS )TestSpecialGraphc                 C   s   t |  tj| _d S N)
_TestGraphsetup_methodr   r   selfr   r   r   r*   6   s    
zTestSpecialGraph.setup_methodNr
   r   r   r*   r   r   r   r   r'   5   s   r'   c                   @   s   e Zd Zdd ZdS )TestThinGraphc                    s   ddi G  fdddt j}|| _     }}}||d||d||dd| _dddg| _d	dd
g| _|  | _| j| j_i | j_i | jjd	< i | jjd< i | jjd
< d S )Nweightr   c                       s   e Zd Z fddZdS )z+TestThinGraph.setup_method.<locals>.MyGraphc                    s    S r(   r   r+   Zall_edge_dictr   r   r   @   s    zBTestThinGraph.setup_method.<locals>.MyGraph.edge_attr_dict_factoryNr
   r   r   r   r   r0   r   r   r   ?   s   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   k3adjk3edgesk3nodesK3r!   r   )r,   r   ed1ed2ed3r   r0   r   r*   <   s     

zTestThinGraph.setup_methodNr-   r   r   r   r   r.   ;   s   r.   c                   @   s   e Zd Zdd ZdS )TestSpecialDiGraphc                 C   s   t |  tj| _d S r(   )_TestDiGraphr*   r   r   r   r+   r   r   r   r*   R   s    
zTestSpecialDiGraph.setup_methodNr-   r   r   r   r   r=   Q   s   r=   c                   @   s   e Zd Zdd ZdS )TestThinDiGraphc                    sR  ddi G  fdddt j}|| _     }}}     }}}||d||d||dd| _dddg| _d	dd
g| _|  | _| j| j_||d||d||dd| j_i | j_	i | jj	d	< i | jj	d< i | jj	d
<    }}|  | _
d|id
|ii d| j
_i d	|id|id| j
_i | j
_	i | j
j	d	< i | j
j	d< i | j
j	d
< d S )Nr/   r   c                       s   e Zd Z fddZdS )z-TestThinDiGraph.setup_method.<locals>.MyGraphc                    s    S r(   r   r+   r0   r   r   r   \   s    zDTestThinDiGraph.setup_method.<locals>.MyGraph.edge_attr_dict_factoryNr1   r   r0   r   r   r   [   s   r   r2   r3   r4   r5   r   r   )r   r   r   r6   r7   r8   r9   r$   r#   r   ZP3)r,   r   r:   r;   r<   Zed4Zed5Zed6r   r0   r   r*   X   s.     

"

zTestThinDiGraph.setup_methodNr-   r   r   r   r   r?   W   s   r?   c                   @   s   e Zd Zdd ZdS )TestSpecialMultiGraphc                 C   s   t |  tj| _d S r(   )_TestMultiGraphr*   r   r   r   r+   r   r   r   r*   {   s    
z"TestSpecialMultiGraph.setup_methodNr-   r   r   r   r   r@   z   s   r@   c                   @   s   e Zd Zdd ZdS )TestSpecialMultiDiGraphc                 C   s   t |  tj| _d S r(   )_TestMultiDiGraphr*   r   r   r   r+   r   r   r   r*      s    
z$TestSpecialMultiDiGraph.setup_methodNr-   r   r   r   r   rB      s   rB   )Znetworkxr   Ztest_digraphr   r   r>   Z
test_graphr   r   r)   Ztest_multidigraphr   rC   Ztest_multigraphr   rA   r&   r'   r.   r=   r?   r@   rB   r   r   r   r   <module>   s   *#