Add test for ImageCollection.concatenate

This commit is contained in:
Juan Nunez-Iglesias
2012-07-20 15:35:03 -05:00
parent 11c7fd2f59
commit 62ce6f3ab5
+9
View File
@@ -23,9 +23,12 @@ if sys.version_info[0] > 2:
class TestImageCollection():
pattern = [os.path.join(data_dir, pic) for pic in ['camera.png',
'color.png']]
pattern_matched = [os.path.join(data_dir, pic) for pic in
['camera.png', 'moon.png']]
def setUp(self):
self.collection = ImageCollection(self.pattern)
self.collection_matched = ImageCollection(self.pattern_matched)
def test_len(self):
assert len(self.collection) == 2
@@ -59,6 +62,12 @@ class TestImageCollection():
ic = ImageCollection(load_pattern, load_func=load_fn)
assert_equal(ic[1], (2, 'two'))
def test_concatenate(self):
ar = self.collection_matched.concatenate()
assert_equal(ar.shape, (len(self.collection_matched),) +
self.collection[0].shape)
assert_raises(ValueError, self.collection.concatenate)
class TestMultiImage():