From 7df2ef1e850cefd5fcbd62d1dd27bae1bef975a1 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 21 Aug 2013 17:50:21 +0200 Subject: [PATCH] Add tests for image tags. --- skimage/io/tests/test_image.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 skimage/io/tests/test_image.py diff --git a/skimage/io/tests/test_image.py b/skimage/io/tests/test_image.py new file mode 100644 index 00000000..6c54695b --- /dev/null +++ b/skimage/io/tests/test_image.py @@ -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() +