
    Vh                     >    d dl Z d dlZd Zd Zd Zd Zd Zd Zd Z	y)	    Nc                      t        j                         } t         j                  j                  | d      }h d}||k(  sJ y )N   source   r            
   r   nxkarate_club_graph	communitygreedy_source_expansion)Gr   expecteds      ^/home/dcms/DCMS/lib/python3.12/site-packages/networkx/algorithms/community/tests/test_local.py(test_greedy_source_expansion_karate_clubr      s<    
A44Qr4BI#H       c                      t        j                         } t         j                  j                  | dd      }|h dk(  sJ y )Nr      )r   cutoff>   r	   r
   r   r   )r   r   s     r   #test_greedy_source_expansion_cutoffr      s9    
A44Qr!4LI
"""r   c                      t        j                         } t        j                  t              5  t         j
                  j                  | ddd       d d d        y # 1 sw Y   y xY w)Nr   r   invalid)r   r   method)r   r   pytestraises
ValueErrorr   r   )r   s    r   +test_greedy_source_expansion_invalid_methodr       sP    
A	z	" W
,,Qr!I,VW W Ws   $AA$c                      g d} t        j                  |       }h d}t         j                  j                  |d      }||k(  sJ y )N)r      r      r%   r   r#   r%   r#   r   r   r   r   r   >   r   r%   r#   r   r   )r   Graphr   r   G_edgesr   r   r   s       r   0test_greedy_source_expansion_connected_componentr.      sA    FG
AH44Qq4AI   r   c                      g d} t        j                  |       }h d}t         j                  j                  |d      }||k(  sJ y )N)r"   r$   r&   r'   r(   r)   r*   )r   r	   )r	   r   )r	   r
   )r   r
   >   r   r%   r#   r
   r   r   )r   DiGraphr   r   r,   s       r   +test_greedy_source_expansion_directed_graphr1   '   sE    G 	

7AH44Qq4AI   r   c                      t        j                  t        j                               } | j                  dd       | j                  dd       h d}t         j                  j                  | d      }||k(  sJ y )Nr   r%   	   r   r   r   )r   
MultiGraphr   add_edger   r   )r   r   r   s      r   'test_greedy_source_expansion_multigraphr6   <   sa    
b**,-AJJq!JJq!#H44Qr4BI   r   c                      t        j                         } | j                  t        d             dh}t         j                  j                  | d      |k(  sJ y )Nr	   r   r   )r   r+   add_nodes_fromranger   r   )r   r   s     r   (test_greedy_source_expansion_empty_graphr:   H   sH    

AU1XsH<<//!/<HHHr   )
r   networkxr   r   r   r    r.   r1   r6   r:    r   r   <module>r=      s0     !#W!!*	!Ir   