Pillow/Tests/test_imagesequence.py

30 lines
568 B
Python
Raw Normal View History

2014-06-10 13:10:47 +04:00
from helper import unittest, PillowTestCase, tearDownModule, lena
from PIL import ImageSequence
2014-06-10 13:10:47 +04:00
class TestImageSequence(PillowTestCase):
2014-06-10 13:10:47 +04:00
def test_sanity(self):
2014-06-10 13:10:47 +04:00
file = self.tempfile("temp.im")
2014-06-10 13:10:47 +04:00
im = lena("RGB")
im.save(file)
2014-06-10 13:10:47 +04:00
seq = ImageSequence.Iterator(im)
2014-06-10 13:10:47 +04:00
index = 0
for frame in seq:
self.assert_image_equal(im, frame)
self.assertEqual(im.tell(), index)
index = index + 1
self.assertEqual(index, 1)
if __name__ == '__main__':
unittest.main()
# End of file