Skip to content

Commit

Permalink
Added unit test of gif export
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Feb 28, 2015
1 parent 5841124 commit 7104739
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testexportclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
from io import BytesIO

from holoviews import HoloMap
from holoviews.element import Image
from holoviews.plotting import Export
from holoviews.core.options import SaveOptions
Expand Down Expand Up @@ -31,6 +32,7 @@ class ExportTest(ComparisonTestCase):
def setUp(self):
self.image1 = Image(np.array([[0,1],[2,3]]))
self.image2 = Image(np.array([[1,0],[4,-2]]))
self.map1 = HoloMap({1:self.image1, 2:self.image2})

def test_simple_export_png1(self):
Export.save(self.image1, fmt='png')
Expand All @@ -42,6 +44,11 @@ def test_simple_export_png2(self):
self.assertEqual(digest_data(Export.captured_data),
'e47fca35d069cdbf5ab0f3337c408ed7ed3e366baba7ec650abb8711394e8b1d')

def test_simple_export_gif(self):
Export.save(self.map1, fmt='gif')
self.assertEqual(digest_data(Export.captured_data),
'8b225c069ba56fb67774996e4a07dd8e3ac11f4df6566a2513d1cf489003159f')



if __name__ == "__main__":
Expand Down

0 comments on commit 7104739

Please sign in to comment.