From 4fa4e19bf369beca6c0f507a8d4100ec50751a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 6 Oct 2012 19:06:17 +0200 Subject: [PATCH] Full test coverage for polygon approximation and subdivision --- skimage/measure/tests/test_polygon.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skimage/measure/tests/test_polygon.py b/skimage/measure/tests/test_polygon.py index 1907d7cb..c96aed88 100644 --- a/skimage/measure/tests/test_polygon.py +++ b/skimage/measure/tests/test_polygon.py @@ -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()