mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
Merge pull request #825 from ahojnnes/coverage
MRG: Increase test coverage
This commit is contained in:
@@ -2,7 +2,7 @@ import warnings
|
||||
|
||||
import numpy as np
|
||||
from numpy.testing import assert_array_almost_equal as assert_close
|
||||
from numpy.testing import assert_array_equal
|
||||
from numpy.testing import assert_array_equal, assert_raises
|
||||
import skimage
|
||||
from skimage import data
|
||||
from skimage import exposure
|
||||
@@ -230,6 +230,11 @@ def test_adjust_gamma_greater_one():
|
||||
assert_array_equal(result, expected)
|
||||
|
||||
|
||||
def test_adjust_gamma_neggative():
|
||||
image = np.arange(0, 255, 4, np.uint8).reshape(8,8)
|
||||
assert_raises(ValueError, exposure.adjust_gamma, image, -1)
|
||||
|
||||
|
||||
# Test Logarithmic Correction
|
||||
# ===========================
|
||||
|
||||
@@ -336,3 +341,8 @@ def test_adjust_inv_sigmoid_cutoff_half():
|
||||
|
||||
result = exposure.adjust_sigmoid(image, 0.5, 10, True)
|
||||
assert_array_equal(result, expected)
|
||||
|
||||
|
||||
def test_neggative():
|
||||
image = np.arange(-10, 245, 4).reshape(8, 8).astype(np.double)
|
||||
assert_raises(ValueError, exposure.adjust_gamma, image)
|
||||
|
||||
Reference in New Issue
Block a user