Add tests for image tags.

This commit is contained in:
Stefan van der Walt
2013-08-21 17:50:21 +02:00
parent 2b0f037422
commit 7df2ef1e85
+17
View File
@@ -0,0 +1,17 @@
from skimage.io import Image
from numpy.testing import assert_equal, assert_array_equal
def test_tags():
f = Image([1, 2, 3], foo='bar', sigma='delta')
g = Image([3, 2, 1], sun='moon')
h = Image([1, 1, 1])
assert_equal(f.tags['foo'], 'bar')
assert_array_equal((g + 2).tags['sun'], 'moon')
assert_equal(h.tags, {})
if __name__ == "__main__":
from numpy.testing import run_module_suite
run_module_suite()