Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/tests/__pycache__/test_connected_components.cpython-39.pyc
Ðазад
a ^�h� � @ sF d Z ddlZddlmZmZmZmZ ddlmZ G dd� dej �Z dS ) z_Provides unit tests to verify that the connected components algorithm is functioning correctly.� N� )�UndirectedGraph�get_connected_components�%get_connected_components_as_subgraphs� make_subgraph� )�utility_functionsc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) �ConnectedComponentsTestc C s� t �� }g d�}dg}ddg}|||g}t|�}| �dt|�� d}|D ]n}d} |D ]F} d}|D ]}|| vr`d} qvq`|r�t|�t| �k} | rT|d7 } q�qT| sHd �||�} | �| � qH| �d|� d S )ziDoes the ''connected_components'' function return the proper component breakdown for an undirected graph?�r r � � � � � r FTr zComponent {} not found in {}N)r �build_simple_test_graphr �assertEqual�len�format�fail)�self�graph�component_a�component_b�component_c�known_components� components�found_components_count�kc�found_known_component�cZsuperset_match�n�msg� r"