def test_build_graph__node_names(self): graph = build_graph(self.connections) node_list = list(graph.nodes()) self.assertEqual( sorted(node_list), sorted([ 'Concatenate_Xy', 'Gaussian_Mixture', 'Dbscan', 'Combine_Clustering', 'Regressor', ]))
def test_build_graph__node_edges(self): graph = build_graph(self.connections) in_edges = { name: [origin for origin, destination in list(graph.in_edges(name))] for name in graph } logger.debug("in_edges: %s", in_edges) self.assertEqual(in_edges['Gaussian_Mixture'], ['Concatenate_Xy']) self.assertEqual(in_edges['Dbscan'], ['Concatenate_Xy']) self.assertEqual(sorted(in_edges['Combine_Clustering']), sorted(['Gaussian_Mixture', 'Dbscan']))
def test_build_graph__connections_None(self): graph = build_graph(None) self.assertTrue(graph is None)