U
    ?h  ć                   @   s"   d dl Z d dlZG dd dZdS )é    Nc                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )ŚTestReciprocityc                 C   s(   t  ddg”}t  |”}|dks$td S )N©é   é   )r   r   g      š?©ŚnxŚDiGraphŚreciprocityŚAssertionError©ŚselfŚDGr	   © r   ś\/var/www/html/venv/lib/python3.8/site-packages/networkx/algorithms/tests/test_reciprocity.pyŚtest_reciprocity_digraph   s    
z(TestReciprocity.test_reciprocity_digraphc              	   C   s.   t  tj” t ” }t |” W 5 Q R X d S )N)ŚpytestŚraisesr   ŚNetworkXErrorr   Zoverall_reciprocity©r   r   r   r   r   Ś$test_overall_reciprocity_empty_graph   s    z4TestReciprocity.test_overall_reciprocity_empty_graphc                 C   s:   t  dddg”}t  |ddg”}ddd}||ks6td S )Nr   ©r   é   ©r   r   r   r   g        ēUUUUUUå?r   )r   r   r	   Zexpected_reciprocityr   r   r   Śtest_reciprocity_graph_nodes   s    
z,TestReciprocity.test_reciprocity_graph_nodesc                 C   s,   t  dddg”}t  |d”}|dks(td S )Nr   r   r   r   r   r   r   r   r   r   Śtest_reciprocity_graph_node   s    z+TestReciprocity.test_reciprocity_graph_nodec              	   C   s>   t  tj”( t dg”}| d” t |d” W 5 Q R X d S )Nr   é   )r   r   r   r   r   Śadd_noder	   r   r   r   r   Ś%test_reciprocity_graph_isolated_nodes!   s    
z5TestReciprocity.test_reciprocity_graph_isolated_nodesN)Ś__name__Ś
__module__Ś__qualname__r   r   r   r   r   r   r   r   r   r      s
   r   )r   Znetworkxr   r   r   r   r   r   Ś<module>   s   