diff python/testgraph.py @ 278:9fca39eebe50

First implementation of regalloc with coalsesc
author Windel Bouwman
date Sun, 29 Sep 2013 14:08:15 +0200
parents 046017431c6a
children 2ccd57b1d78c
line wrap: on
line diff
--- a/python/testgraph.py	Thu Sep 26 21:14:25 2013 +0200
+++ b/python/testgraph.py	Sun Sep 29 14:08:15 2013 +0200
@@ -5,9 +5,11 @@
 
 class GraphTestCase(unittest.TestCase):
     def testEdge(self):
-        g = graph.Graph(False)
-        n1 = g.newNode()
-        n2 = g.newNode()
+        g = graph.Graph()
+        n1 = graph.Node(g)
+        g.addNode(n1)
+        n2 = graph.Node(g)
+        g.addNode(n2)
         g.addEdge(n1, n2)
         self.assertTrue(g.hasEdge(n2, n1))
         self.assertTrue(g.hasEdge(n1, n2))
@@ -15,10 +17,13 @@
         g.delNode(n2)
 
     def testDegree(self):
-        g = graph.Graph(False)
-        n1 = g.newNode()
-        n2 = g.newNode()
-        n3 = g.newNode()
+        g = graph.Graph()
+        n1 = graph.Node(g)
+        g.addNode(n1)
+        n2 = graph.Node(g)
+        g.addNode(n2)
+        n3 = graph.Node(g)
+        g.addNode(n3)
         g.addEdge(n1, n2)
         g.addEdge(n1, n3)
         self.assertEqual(2, n1.Degree)