Commit aad7c0bd authored by Matt Clarkson's avatar Matt Clarkson

Issue #8: Added extra unit tests for when validation passes.

parent d5a54cd1
......@@ -51,3 +51,7 @@ def test_width_height_invalid_because_height_wrong_type():
def test_width_height_invalid_because_height_too_low():
with pytest.raises(ValueError):
v.validate_width_height((1, 0))
def test_width_height_valid():
assert v.validate_width_height((1, 1))
......@@ -39,6 +39,11 @@ def test_camera_matrix_invalid_because_too_many_columns():
vm.validate_camera_matrix(np.ones((3, 4)))
def test_camera_matrix_valid():
camera_matrix = np.ones((3, 3))
assert vm.validate_camera_matrix(camera_matrix)
def test_distortion_coefficients_invalid_because_wrong_type():
with pytest.raises(TypeError):
vm.validate_distortion_coefficients(1)
......@@ -65,6 +70,11 @@ def test_distortion_coefficients_invalid_because_number_of_columns_not_in_list()
vm.validate_distortion_coefficients(np.ones((1, 6)))
def test_distortion_coefficients_valid():
distortion_coeff = np.ones((1, 5))
assert vm.validate_distortion_coefficients(distortion_coeff)
def test_rotation_matrix_invalid_because_wrong_type():
with pytest.raises(TypeError):
vm.validate_rotation_matrix(1)
......@@ -95,6 +105,11 @@ def test_rotation_matrix_invalid_because_too_few_columns():
vm.validate_rotation_matrix(np.ones((3, 2)))
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)
......@@ -118,3 +133,8 @@ def test_translation_matrix_invalid_because_too_many_columns():
def test_translation_matrix_invalid_because_too_few_rows():
with pytest.raises(ValueError):
vm.validate_translation_column_vector(np.ones((2, 1)))
def test_translation_matrix_valid():
translation_matrix = np.zeros((3, 1))
assert vm.validate_translation_column_vector(translation_matrix)
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