예제 #1
0
 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)
예제 #2
0
파일: InputModules.py 프로젝트: kown7/rmtoo
 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)
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
파일: TestScc.py 프로젝트: samjaninf/rmtoo
 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")
예제 #6
0
 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
예제 #7
0
 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")
예제 #8
0
 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"
예제 #9
0
파일: RMTTest-Scc.py 프로젝트: kown7/rmtoo
 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"
예제 #10
0
 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)
예제 #11
0
 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")
예제 #12
0
 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")