From e8ab5559d5b3972065ae4e4403cb4b3b3f53596b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 10 May 2014 10:47:52 -0400 Subject: [PATCH] Test invalid input for unwrap_phase --- skimage/restoration/tests/test_unwrap.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skimage/restoration/tests/test_unwrap.py b/skimage/restoration/tests/test_unwrap.py index 3d548fc3..fca63724 100644 --- a/skimage/restoration/tests/test_unwrap.py +++ b/skimage/restoration/tests/test_unwrap.py @@ -137,5 +137,12 @@ def test_mask(): assert_array_almost_equal(image_unwrapped_3d[:, :, -1], image[i, -1]) +def test_invalid_input(): + assert_raises(ValueError, unwrap_phase, np.zeros([])) + assert_raises(ValueError, unwrap_phase, np.zeros((1, 1, 1, 1))) + assert_raises(ValueError, unwrap_phase, np.zeros((1, 1)), 3 * [False]) + assert_raises(ValueError, unwrap_phase, np.zeros((1, 1)), 'False') + + if __name__ == "__main__": run_module_suite()