From 5101aa2a389c005e3be0eba22c5c5c168493fcf4 Mon Sep 17 00:00:00 2001 From: "Jonathan J. Helmus" Date: Fri, 20 Jul 2012 15:23:25 -0400 Subject: [PATCH] added test for ImageCollection slicing --- skimage/io/tests/test_collection.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skimage/io/tests/test_collection.py b/skimage/io/tests/test_collection.py index 0d420ae7..36e78e13 100644 --- a/skimage/io/tests/test_collection.py +++ b/skimage/io/tests/test_collection.py @@ -43,6 +43,12 @@ class TestImageCollection(): assert_raises(IndexError, return_img, num) assert_raises(IndexError, return_img, -num - 1) + def test_slicing(self): + assert type(self.collection[:] is ImageCollection) + assert len(self.collection[:]) == 2 + assert_array_almost_equal(self.collection[0], self.collection[:1]) + assert_array_almost_equal(self.collection[1], self.collection[1:]) + def test_files_property(self): assert isinstance(self.collection.files, list)