Skip to content

Commit

Permalink
Added unit test for bokeh png renderering
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 29, 2017
1 parent 97eefb0 commit 300c215
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install:
- conda info -a
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION scipy=0.18.1 numpy freetype nose bokeh=0.12.5 pandas=0.19.2 jupyter ipython=4.2.0 param pyqt=4 matplotlib=1.5.1 xarray datashader dask=0.13
- source activate test-environment
- conda install -c conda-forge -c scitools iris sip=4.18 plotly flexx
- conda install -c conda-forge iris sip=4.18 plotly flexx selenium phantomjs
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then
conda install python=3.4.3;
fi
Expand Down
9 changes: 8 additions & 1 deletion tests/testrenderclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from nose.plugins.attrib import attr
import numpy as np

from holoviews import HoloMap, Image, ItemTable, Store, GridSpace, Table
from holoviews import HoloMap, Image, ItemTable, Store, GridSpace, Table, Curve
from holoviews.element.comparison import ComparisonTestCase
from holoviews.plotting import Renderer

Expand Down Expand Up @@ -146,3 +146,10 @@ def test_get_size_tables_in_layout(self):
plot = self.renderer.get_plot(table+table)
w, h = self.renderer.get_size(plot)
self.assertEqual((w, h), (680, 300))

def test_render_to_png(self):
curve = Curve([])
renderer = BokehRenderer.instance(fig='png')
png, info = renderer(curve)
self.assertIsInstance(png, bytes)
self.assertEqual(info['file-ext'], 'png')

0 comments on commit 300c215

Please sign in to comment.