Beispiel #1
0
 def testCycleNodes(self):
     g = DalGraph(make_cycle(3))
     c = g.cycle_nodes()
     self.assertEqual(c, [], "Cycle Nodes Failed: found cycle less than 3")
     g = DalGraph(make_cycle(5))
     c = g.cycle_nodes()
     self.assertEqual(c, [0, 1, 2, 3, 4 ,0], 
                      "Cycle Nodes Failed: did not find C5")
     c5 = make_cycle(5)
     c5.add_edge(2,4)
     g = DalGraph(c5)
     c = g.cycle_nodes()
     self.assertEqual(c, [], "Cycle Nodes Failed: did found non-induced C5")