Example #1
0
 def testAddEdge(self):
     g = graph.T()
     n = g.newNode()
     n2 = g.newNode()
     g.newEdge(n, n2)
     self.assertEqual(g.succ(n), [n2])
     self.assertEqual(g.pred(n2), [n])
Example #2
0
 def testAddTwoEdges(self):
     g = graph.T()
     n = g.newNode()
     n2 = g.newNode()
     n3 = g.newNode()
     g.newEdge(n, n2)
     g.newEdge(n, n3)
     self.assertEqual(g.succ(n), [n2, n3])
     self.assertEqual(g.pred(n2), [n])
     self.assertEqual(g.pred(n3), [n])
Example #3
0
 def testAdd(self):
     g = graph.T()
     n = g.newNode()
     self.assertEqual(g.succ(n), [])
     self.assertEqual(g.pred(n), [])
Example #4
0
 def testNew(self):
     g = graph.T()