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

Method test_layout

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

Source from the content-addressed store, hash-verified

347class TestGraphSpringLayout(TestGraphLayout):
348
349 def test_layout(self):
350 # Assert GraphSpringLayout properties.
351 gl = self.g.layout
352 self.assertTrue(gl.graph == self.g)
353 self.assertTrue(gl.k == 4.0)
354 self.assertTrue(gl.force == 0.01)
355 self.assertTrue(gl.repulsion == 15)
356 self.assertTrue(gl.bounds == (0,0,0,0))
357 self.assertTrue(gl.iterations == 0)
358 gl.update()
359 self.assertTrue(gl.iterations == 1)
360 self.assertTrue(gl.bounds[0] < 0)
361 self.assertTrue(gl.bounds[1] < 0)
362 self.assertTrue(gl.bounds[2] > 0)
363 self.assertTrue(gl.bounds[3] > 0)
364 print "pattern.graph.GraphSpringLayout"
365
366 def test_distance(self):
367 # Assert 2D distance.

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected