Esempio n. 1
0
 def test_partition(self):
     # Assert unconnected subgraph partitioning.
     g = graph.partition(self.g)
     self.assertTrue(len(g) == 3)
     self.assertTrue(isinstance(g[0], graph.Graph))
     self.assertTrue(sorted(g[0].keys()), ["a", "b", "c", "d", "e"])
     self.assertTrue(sorted(g[1].keys()), ["x", "y"])
     self.assertTrue(sorted(g[2].keys()), ["z"])
     print "pattern.graph.partition()"
Esempio n. 2
0
 def test_partition(self):
     # Assert unconnected subgraph partitioning.
     g = graph.partition(self.g)
     self.assertTrue(len(g) == 3)
     self.assertTrue(isinstance(g[0], graph.Graph))
     self.assertTrue(sorted(g[0].keys()), ["a","b","c","d","e"])
     self.assertTrue(sorted(g[1].keys()), ["x","y"])
     self.assertTrue(sorted(g[2].keys()), ["z"])
     print "pattern.graph.partition()"