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

Method test_betweenness_centrality

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

Source from the content-addressed store, hash-verified

247 print "pattern.graph.Graph.eigenvector_centrality()"
248
249 def test_betweenness_centrality(self):
250 # Assert betweenness centrality.
251 self.assertEqual(self.g["a"]._centrality, None)
252 v = self.g.betweenness_centrality()
253 self.assertTrue(isinstance(v["a"], float))
254 self.assertTrue(v["a"] == v[self.g.node("a")])
255 self.assertTrue(v["a"] < v["b"])
256 self.assertTrue(v["c"] < v["b"])
257 print "pattern.graph.Graph.betweenness_centrality()"
258
259 def test_sorted(self):
260 # Assert graph node sorting

Callers

nothing calls this directly

Calls 2

nodeMethod · 0.80

Tested by

no test coverage detected