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

Method test_attraction

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

Source from the content-addressed store, hash-verified

384 print "pattern.graph.GraphSpringLayout._repulse()"
385
386 def test_attraction(self):
387 # Assert attractive edge force.
388 gl = self.g.layout
389 self.g["a"].x = -100
390 self.g["b"].y = +100
391 d1 = gl._distance(self.g["a"], self.g["b"])[2]
392 gl.update()
393 d2 = gl._distance(self.g["a"], self.g["b"])[2]
394 self.assertTrue(d2 < d1)
395 print "pattern.graph.GraphSpringLayout._attract()"
396
397#---------------------------------------------------------------------------------------------------
398

Callers

nothing calls this directly

Calls 2

_distanceMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected