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

Method test_repulsion

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

Source from the content-addressed store, hash-verified

374 print "pattern.graph.GraphSpringLayout._distance"
375
376 def test_repulsion(self):
377 # Assert repulsive node force.
378 gl = self.g.layout
379 d1 = gl._distance(self.g["a"], self.g["c"])[2]
380 gl.update()
381 d2 = gl._distance(self.g["a"], self.g["c"])[2]
382 self.assertTrue(d2 > d1)
383 self.g.layout.reset()
384 print "pattern.graph.GraphSpringLayout._repulse()"
385
386 def test_attraction(self):
387 # Assert attractive edge force.

Callers

nothing calls this directly

Calls 3

_distanceMethod · 0.45
updateMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected