mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 04:20:24 +08:00
Test invalid input for seed
This commit is contained in:
@@ -8,7 +8,8 @@ All rights reserved.
|
||||
Original author: Lee Kamentsky
|
||||
"""
|
||||
import numpy as np
|
||||
from numpy.testing import assert_array_almost_equal as assert_close
|
||||
from numpy.testing import (assert_array_almost_equal as assert_close,
|
||||
assert_raises)
|
||||
|
||||
from skimage.morphology.greyreconstruct import reconstruction
|
||||
|
||||
@@ -77,6 +78,15 @@ def test_fill_hole():
|
||||
assert_close(result, np.array([0, 3, 6, 4, 4, 4, 4, 4, 2, 0]))
|
||||
|
||||
|
||||
def test_invalid_seed():
|
||||
seed = np.ones((5, 5))
|
||||
mask = np.ones((5, 5))
|
||||
assert_raises(ValueError, reconstruction, seed * 2, mask,
|
||||
method='dilation')
|
||||
assert_raises(ValueError, reconstruction, seed * 0.5, mask,
|
||||
method='erosion')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from numpy import testing
|
||||
testing.run_module_suite()
|
||||
|
||||
Reference in New Issue
Block a user