Commit 8263551f authored by bongjinkoo's avatar bongjinkoo

Issue #7: Finish implementing validate_rotation_matrix() and its tests.

parent 1aeff04b
Pipeline #1375 failed with stages
in 21 minutes and 39 seconds
......@@ -27,10 +27,10 @@ def test_using_pytest_cookienewwithgitinit_withTK():
six.print_("Got another error (not TCL), that's not OK.")
assert False
except ModuleNotFoundError:
six.print_("Got module not found on tkinter, please check your python installation")
#except ModuleNotFoundError:
#six.print_("Got module not found on tkinter, please check your python installation")
#we're not trying to test whether we have tkinter so this is ok
assert True
#assert True
except ImportError:
six.print_("Got import error on tkinter, please check your python installation")
#we're not trying to test whether we have tkinter so this is ok
......
......@@ -104,14 +104,22 @@ def test_rotation_matrix_invalid_because_too_few_columns():
with pytest.raises(ValueError):
vm.validate_rotation_matrix(np.ones((3, 2)))
def test_rotation_matrix_invalid_because_not_orthogonal():
with pytest.raises(ValueError):
vm.validate_rotation_matrix(np.array([[3, -4, 1], [5, 3, -7], [-9, 2, 6]]))
vm.validate_rotation_matrix(np.array([[3.0, -4.0, 1.0], [5.0, 3.0, -7.0], [-9.0, 2.0, 6.0]]))
def test_rotation_matrix_invalid_because_determinant_not_positive():
with pytest.raises(ValueError):
vm.validate_rotation_matrix(np.array([[-1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]))
def test_rotation_matrix_valid():
rotation_matrix = np.eye(3)
assert vm.validate_rotation_matrix(rotation_matrix)
def test_translation_matrix_invalid_because_wrong_type():
with pytest.raises(TypeError):
vm.validate_translation_column_vector(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment