o
    3ήc                     @   sH   d Z ddlZddlmZmZ ddlmZmZ dd Zdd Z	d	d
 Z
dS )zLUnit tests for the :mod:`networkx.algorithms.bipartite.redundancy` module.

    N)NetworkXErrorcycle_graph)complete_bipartite_graphnode_redundancyc                  C   s0   t dd} t| }tdd | D sJ d S )N   c                 s   s    | ]}|d kV  qdS )   N ).0
redundancyr   r   Z/tmp/pip-target-vg8gfxp4/lib/python/networkx/algorithms/bipartite/tests/test_redundancy.py	<genexpr>   s    z*test_no_redundant_nodes.<locals>.<genexpr>)r   r   allvalues)Grcr   r   r   test_no_redundant_nodes   s   
r   c                  C   sb   t d} ddh}| j|  t| }|D ]
}|| dksJ qt| | D ]
}|| dks.J q$d S )N   r      gUUUUUU?r   )r   add_edger   set)r   edger
   vr   r   r   test_redundant_nodes   s   
r   c                  C   sB   t t tdd} t|  W d    d S 1 sw   Y  d S )Nr   r   )pytestraisesr   r   r   )r   r   r   r   test_not_enough_neighbors   s   

"r   )__doc__r   networkxr   r   networkx.algorithms.bipartiter   r   r   r   r   r   r   r   r   <module>   s    