Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asnt committed Oct 14, 2018
1 parent ea3dd97 commit ba98162
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pyrr/tests/test_matrix33.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ def test_create_from_axis_rotation_non_normalized(self):
np.testing.assert_almost_equal(result, matrix33.create_from_quaternion([5.77350000e-01, 5.77350000e-01, 5.77350000e-01, 6.12323400e-17]), decimal=3)
self.assertTrue(result.dtype == np.float)

def test_create_from_axis_rotation_float_dtype_by_default(self):
axis_int = [1, 0, 0]
result = matrix33.create_from_axis_rotation(axis_int, np.pi)
self.assertTrue(result.dtype == np.float)

def test_create_from_axis_rotation_override_dtype(self):
result = matrix33.create_from_axis_rotation([1.0, 0.0, 0.0], np.pi, dtype=int)
self.assertTrue(result.dtype == np.int)

def test_create_from_x_rotation(self):
mat = matrix33.create_from_x_rotation(np.pi / 2.)
self.assertTrue(np.allclose(np.dot([1.,0.,0.], mat), [1.,0.,0.]))
Expand Down

0 comments on commit ba98162

Please sign in to comment.