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])
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])
def testAdd(self): g = graph.T() n = g.newNode() self.assertEqual(g.succ(n), []) self.assertEqual(g.pred(n), [])
def testNew(self): g = graph.T()