
    ިsg                     (    d dl Z d dlZ G d d      Zy)    Nc                   *    e Zd Zd Zd Zd Zd Zd Zy)TestReciprocityc                 j    t        j                  ddg      }t        j                  |      }|dk(  sJ y )N      )r   r   g      ?nxDiGraphreciprocityselfDGr   s      ]/var/www/html/venv/lib/python3.12/site-packages/networkx/algorithms/tests/test_reciprocity.pytest_reciprocity_digraphz(TestReciprocity.test_reciprocity_digraph   s1    ZZ()nnR(c!!!    c                     t        j                  t        j                        5  t        j                         }t        j
                  |       d d d        y # 1 sw Y   y xY w)N)pytestraisesr
   NetworkXErrorr   overall_reciprocityr   r   s     r   $test_overall_reciprocity_empty_graphz4TestReciprocity.test_overall_reciprocity_empty_graph   sB    ]]2++, 	'B""2&	' 	' 	's   *AA c                 z    t        j                  g d      }t        j                  |ddg      }ddd}||k(  sJ y )Nr   )r      )r   r   r   r   g        UUUUUU?r   r	   )r   r   r   expected_reciprocitys       r   test_reciprocity_graph_nodesz,TestReciprocity.test_reciprocity_graph_nodes   s@    ZZ01nnR!Q0#&+=>2222r   c                 l    t        j                  g d      }t        j                  |d      }|dk(  sJ y )Nr   r   r   r	   r   s      r   test_reciprocity_graph_nodez+TestReciprocity.test_reciprocity_graph_node   s0    ZZ01nnR+0000r   c                     t        j                  t        j                        5  t        j                  dg      }|j                  d       t        j                  |d       d d d        y # 1 sw Y   y xY w)Nr      )r   r   r
   r   r   add_noder   r   s     r   %test_reciprocity_graph_isolated_nodesz5TestReciprocity.test_reciprocity_graph_isolated_nodes!   sR    ]]2++, 	"VH%BKKNNN2q!	" 	" 	"s   >A++A4N)__name__
__module____qualname__r   r   r   r!   r%    r   r   r   r      s    "'31"r   r   )r   networkxr
   r   r)   r   r   <module>r+      s     " "r   