Merge pull request #825 from ahojnnes/coverage

MRG: Increase test coverage
This commit is contained in:
Stefan van der Walt
2013-12-03 00:29:15 -08:00
16 changed files with 222 additions and 257 deletions
+11 -1
View File
@@ -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)