mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 10:53:30 +08:00
Full test coverage for polygon approximation and subdivision
This commit is contained in:
committed by
Stefan van der Walt
parent
96799d4795
commit
4fa4e19bf3
@@ -22,6 +22,8 @@ def test_approximate_polygon():
|
||||
|
||||
out = approximate_polygon(square, -1)
|
||||
np.testing.assert_array_equal(out, square)
|
||||
out = approximate_polygon(square, 0)
|
||||
np.testing.assert_array_equal(out, square)
|
||||
|
||||
|
||||
def test_subdivide_polygon():
|
||||
@@ -51,6 +53,10 @@ def test_subdivide_polygon():
|
||||
np.testing.assert_equal(new_square3.shape[0],
|
||||
2 * (square3.shape[0] - mask_len + 2))
|
||||
|
||||
# not supported B-Spline degree
|
||||
np.testing.assert_raises(ValueError, subdivide_polygon, square, 0)
|
||||
np.testing.assert_raises(ValueError, subdivide_polygon, square, 8)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
np.testing.run_module_suite()
|
||||
|
||||
Reference in New Issue
Block a user