MCPcopy Index your code
hub / github.com/clips/pattern / test_partition

Method test_partition

test/test_graph.py:578–586  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

576 self.assertEqual(graph.difference([1,2],[2,3]), [1])
577
578 def test_partition(self):
579 # Assert unconnected subgraph partitioning.
580 g = graph.partition(self.g)
581 self.assertTrue(len(g) == 3)
582 self.assertTrue(isinstance(g[0], graph.Graph))
583 self.assertTrue(sorted(g[0].keys()), ["a","b","c","d","e"])
584 self.assertTrue(sorted(g[1].keys()), ["x","y"])
585 self.assertTrue(sorted(g[2].keys()), ["z"])
586 print "pattern.graph.partition()"
587
588 def test_clique(self):
589 # Assert node cliques.

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
keysMethod · 0.45

Tested by

no test coverage detected