o
    3Î®cd  ã                   @   s.   d Z ddlZddlmZmZ G dd„ dƒZdS )zGUnit tests for the :mod:`networkx.algorithms.tree.operations` module.

é    N)Úedges_equalÚnodes_equalc                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚTestJoinz7Unit tests for the :func:`networkx.tree.join` function.c                 C   s.   t  g ¡}t|ƒdksJ ‚| ¡ dksJ ‚dS )zZTests that joining the empty sequence results in the tree
        with one node.

        é   r   N)ÚnxÚjoinÚlenÚnumber_of_edges)ÚselfÚT© r   úU/tmp/pip-target-vg8gfxp4/lib/python/networkx/algorithms/tree/tests/test_operations.pyÚtest_empty_sequence   s   
zTestJoin.test_empty_sequencec                 C   s\   t  d¡}t  |dfg¡}t  d¡}tt|ƒt|ƒƒsJ ‚tt| ¡ ƒt| ¡ ƒƒs,J ‚dS )zTTests that joining just one tree yields a tree with one more
        node.

        r   r   é   N)r   Úempty_graphr   Ú
path_graphr   Úlistr   Úedges)r
   r   ÚactualÚexpectedr   r   r   Útest_single   s
   

"zTestJoin.test_singlec                 C   s<   dd„ t dƒD ƒ}t |¡}t dd¡}t ||¡sJ ‚dS )z3Tests for joining multiple subtrees at a root node.c                 S   s   g | ]
}t  d d¡df‘qS )r   é   r   )r   Úfull_rary_tree)Ú.0Úir   r   r   Ú
<listcomp>"   s    z'TestJoin.test_basic.<locals>.<listcomp>r   é   N)Úranger   r   r   Úis_isomorphic)r
   Útreesr   r   r   r   r   Ú
test_basic    s   
zTestJoin.test_basicN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r   r   r   r   r   	   s
    	r   )r$   Únetworkxr   Únetworkx.utilsr   r   r   r   r   r   r   Ú<module>   s    