def __check_for_circles(self): '''This does check if there is a directed circle (e.g. an strongly connected component) in the modules graph.''' scc = strongly_connected_components(self) if check_for_strongly_connected_components(scc): raise RMTException(26, "There is a strongly connected " "component in the modules graph '%s'" % scc)
def __check_for_circles(self): '''This does check if there is a directed circle (e.g. an strongly connected component) in the modules graph.''' scc = strongly_connected_components(self) if check_for_strongly_connected_components(scc): raise RMTException( 26, "There is a strongly connected " "component in the modules graph '%s'" % scc)
def rewrite(self, reqset): scc = strongly_connected_components(reqset) result = check_for_strongly_connected_components(scc) if result == True: print("+++ ERROR: There is at least one circular " "dependency component: '%s'" % remove_single_element_lists_name_rest(scc)) return False return True
def rewrite(self, reqset): scc = strongly_connected_components(reqset) result = check_for_strongly_connected_components(scc) if result == True: print("+++ ERROR: There is at least one circular " "dependency component: '%s'" % remove_single_element_lists_name_rest(scc)) return False return True
def test_scc_006(self): "Check for scc in a three node digraph with scc" dg = digraph_create_from_dict({ "A": ["B", "C"], "B": ["A"], "C": ["B"] }) sccs = strongly_connected_components(dg) scc_exists = check_for_strongly_connected_components(sccs) self.assertEqual(scc_exists, True, "incorrect")
def rewrite(reqset): """The rewrite function here does mostly a search for strongly connected components. It uses the algorithm from Trajan for this - which is implemented in the digraph library. """ scc = strongly_connected_components(reqset) result = check_for_strongly_connected_components(scc) if result: print("+++ ERROR: There is at least one circular " "dependency component: '%s'" % remove_single_element_lists_name_rest(scc)) return False return True
def rmttest_scc_008(self): "Check for scc in a three node digraph with a two node scc" dg = Digraph({"A": ["B"], "B": ["A"], "C": []}) sccs = strongly_connected_components(dg) scc_exists = check_for_strongly_connected_components(sccs) self.assertEqual(scc_exists, True, "incorrect")
def rmttest_scc_008(self): "Check for scc in a three node digraph with a two node scc" dg = Digraph({"A": ["B"], "B": ["A"], "C": []}) sccs = strongly_connected_components(dg) scc_exists = check_for_strongly_connected_components(sccs) assert scc_exists is True, "incorrect"
def rmttest_scc_007(self): "Check for scc in a three node digraph without scc" dg = Digraph({"A": ["B"], "B": ["C"], "C": []}) sccs = strongly_connected_components(dg) scc_exists = check_for_strongly_connected_components(sccs) assert scc_exists is False, "incorrect"
def check_for_circles(self): scc = strongly_connected_components(self) if check_for_strongly_connected_components(scc): raise RMTException(26, "There is a strongly connected " "component in the modules graph '%s'" % scc)
def test_scc_008(self): "Check for scc in a three node digraph with a two node scc" dg = digraph_create_from_dict({"A": ["B"], "B": ["A"], "C": [] }) sccs = strongly_connected_components(dg) scc_exists = check_for_strongly_connected_components(sccs) self.assertEqual(scc_exists, True, "incorrect")
def test_scc_007(self): "Check for scc in a three node digraph without scc" dg = Digraph({"A": ["B"], "B": ["C"], "C": []}) sccs = strongly_connected_components(dg) scc_exists = check_for_strongly_connected_components(sccs) self.assertEqual(scc_exists, False, "incorrect")