def test_scc_005(self): "Simple three node digraph with one scc II" dg = digraph_create_from_dict({ "A": ["B", "C"], "B": ["A"], "C": ["B"] }) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) self.assertEqual(sccsnames, [set(['A', 'C', 'B'])], "incorrect")
def rmttest_scc_003(self): "Simple three node digraph with one scc and an extra node" dg = Digraph({"A": ["B", "C"], "B": ["A"], "C": []}) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) self.assertEqual(sccsnames, [set(['C']), set(['A', 'B'])], "incorrect")
def rmttest_scc_002(self): "Simple two node digraph with no scc" dg = Digraph({"A": ["B"], "B": []}) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) self.assertEqual(sccsnames, [set(['B']), set(['A'])], "incorrect")
def rmttest_scc_005(self): "Simple three node digraph with one scc II" dg = Digraph({"A": ["B", "C"], "B": ["A"], "C": ["B"]}) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) assert sccsnames == [set(['A', 'C', 'B'])], "incorrect"
def rmttest_scc_002(self): "Simple two node digraph with no scc" dg = Digraph({"A": ["B"], "B": []}) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) assert sccsnames == [set(['B']), set(['A'])], "incorrect"
def test_scc_005(self): "Simple three node digraph with one scc II" dg = digraph_create_from_dict({"A": ["B", "C"], "B": ["A"], "C": ["B"] }) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) self.assertEqual(sccsnames, [set(['A', 'C', 'B'])], "incorrect")
def test_scc_002(self): "Simple two node digraph with no scc" dg = digraph_create_from_dict({"A": ["B"], "B": [] }) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) self.assertEqual(sccsnames, [set(['B']), set(['A'])], "incorrect")
def test_scc_004(self): "Simple three node digraph with one scc I" dg = Digraph({"A": ["B", "C"], "B": ["A"], "C": ["A"]}) sccs = strongly_connected_components(dg) sccsnames = node_sl_to_node_name_sl(sccs) self.assertEqual(sccsnames, [set(["A", "C", "B"])], "incorrect")