From 8b6f489babc7d9c69a2f992fa45b9a6e1ff88462 Mon Sep 17 00:00:00 2001 From: Zach Pincus Date: Thu, 18 Apr 2013 11:08:12 -0400 Subject: [PATCH] Add multipage TIFF unittest --- skimage/io/tests/test_freeimage.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/skimage/io/tests/test_freeimage.py b/skimage/io/tests/test_freeimage.py index 7a294f9e..550b39a2 100644 --- a/skimage/io/tests/test_freeimage.py +++ b/skimage/io/tests/test_freeimage.py @@ -53,7 +53,18 @@ def test_imread_uint16_big_endian(): assert img.dtype == np.uint16 assert_array_almost_equal(img, expected) - +@skipif(not FI_available) +def test_write_multipage(): + shape = (64,64,64) + x = np.ones(shape, dtype=np.uint8) * np.random.random(shape) * 255 + x = x.astype(np.uint8) + f = NamedTemporaryFile(suffix='.tif') + fname = f.name + f.close() + fi.write_multipage(x, fname) + y = fi.read_multipage(fname) + assert_array_equal(x, y) + class TestSave: def roundtrip(self, dtype, x, suffix): f = NamedTemporaryFile(suffix='.' + suffix)