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

Method test_distance

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

Source from the content-addressed store, hash-verified

364 print "pattern.graph.GraphSpringLayout"
365
366 def test_distance(self):
367 # Assert 2D distance.
368 n1 = graph.Node()
369 n2 = graph.Node()
370 n1.x = -100
371 n2.x = +100
372 d = self.g.layout._distance(n1, n2)
373 self.assertEqual(d, (200.0, 0.0, 200.0, 40000.0))
374 print "pattern.graph.GraphSpringLayout._distance"
375
376 def test_repulsion(self):
377 # Assert repulsive node force.

Callers

nothing calls this directly

Calls 1

_distanceMethod · 0.45

Tested by

no test coverage detected