MCPcopy Create free account
hub / github.com/Notgnoshi/generative / test_initial_rotation

Method test_initial_rotation

tests/test_turtle.py:24–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 assert_allclose(turtle.position, (3, 3, 3))
23
24 def test_initial_rotation(self):
25 turtle = Turtle()
26 assert_allclose(turtle.rotation.as_matrix(), np.eye(3))
27
28 # A rotation 180 degrees about the global x axis should flip both the y and z axes.
29 rotation = Rotation.from_euler("x", [np.pi])
30 expected = [[1, 0, 0], [0, -1, 0], [0, 0, -1]]
31 turtle = Turtle(rotation=rotation)
32 # There's a little bit of numerical instability in the works.
33 assert_allclose(turtle.rotation.as_matrix(), [expected], atol=1e-15)
34
35 def test_forward(self):
36 turtle = Turtle()

Callers

nothing calls this directly

Calls 1

TurtleClass · 0.90

Tested by

no test coverage detected