Skip to content

Commit

Permalink
Added unit tests for shared_axes
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 10, 2017
1 parent fd28e25 commit f0f5693
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/testplotinstantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,25 @@ def formatter(x):
plot = bokeh_renderer.get_plot(curve).state
self.assertIsInstance(plot.yaxis[0].formatter, FuncTickFormatter)

def test_shared_axes(self):
curve = Curve(range(10))
img = Image(np.random.rand(10,10))
plot = bokeh_renderer.get_plot(curve+img)
plot = plot.subplots[(0, 1)].subplots['main']
x_range, y_range = plot.handles['x_range'], plot.handles['y_range']
self.assertEqual((x_range.start, x_range.end), (-.5, 9))
self.assertEqual((y_range.start, y_range.end), (-.5, 9))

def test_shared_axes_disable(self):
curve = Curve(range(10))
img = Image(np.random.rand(10,10))(plot=dict(shared_axes=False))
plot = bokeh_renderer.get_plot(curve+img)
plot = plot.subplots[(0, 1)].subplots['main']
x_range, y_range = plot.handles['x_range'], plot.handles['y_range']
self.assertEqual((x_range.start, x_range.end), (-.5, .5))
self.assertEqual((y_range.start, y_range.end), (-.5, .5))



class TestPlotlyPlotInstantiation(ComparisonTestCase):

Expand Down

0 comments on commit f0f5693

Please sign in to comment.