diff --git a/holoviews/tests/plotting/bokeh/test_multiaxis.py b/holoviews/tests/plotting/bokeh/test_multiaxis.py index 10cadf968a..1f71acae65 100644 --- a/holoviews/tests/plotting/bokeh/test_multiaxis.py +++ b/holoviews/tests/plotting/bokeh/test_multiaxis.py @@ -1,3 +1,4 @@ +import pytest from holoviews.element import Curve from .test_plot import TestBokehPlot, bokeh_renderer from bokeh.models import LinearScale, LogScale, LinearAxis, LogAxis @@ -199,3 +200,41 @@ def test_shared_multi_axes(self): self.assertEqual((y_range.start, y_range.end), (5, 19)) self.assertEqual((extra_y_ranges['B'].start, extra_y_ranges['B'].end), (1, 13)) + + @pytest.mark.xfail + def test_swapped_position_label(self): + overlay = (Curve(range(10), vdims=['A']).opts(yaxis='right') + * Curve(range(10), vdims=['B']).opts(yaxis='left') + ).opts(multi_y=True) + plot = bokeh_renderer.get_plot(overlay) + + self.assertEqual(plot.state.yaxis[0].axis_label, 'B') + self.assertEqual(plot.state.yaxis[1].axis_label, 'A') + + + @pytest.mark.xfail + def test_swapped_position_custom_label(self): + overlay = (Curve(range(10), vdims=['A']).opts(yaxis='right', ylabel='A-custom') + * Curve(range(10), vdims=['B']).opts(yaxis='left', ylabel='B-custom') + ).opts(multi_y=True) + plot = bokeh_renderer.get_plot(overlay) + + self.assertEqual(plot.state.yaxis[0].axis_label, 'B-custom') + self.assertEqual(plot.state.yaxis[1].axis_label, 'A-custom') + + @pytest.mark.xfail + def test_position_custom_size_label(self): + overlay = (Curve(range(10), vdims='A').opts(fontsize={'ylabel': '13pt'}) + * Curve(range(10), vdims='B').opts(fontsize={'ylabel': '15pt'})).opts(multi_y=True) + plot = bokeh_renderer.get_plot(overlay) + self.assertEqual(plot.state.yaxis[0].axis_label_text_font_size, '13pt') + self.assertEqual(plot.state.yaxis[1].axis_label_text_font_size, '15pt') + + @pytest.mark.xfail + def test_swapped_position_custom_size_label(self): + overlay = (Curve(range(10), vdims='A').opts(yaxis='right', fontsize={'ylabel': '13pt'}) + * Curve(range(10), vdims='B').opts(yaxis='left', + fontsize={'ylabel': '15pt'})).opts(multi_y=True) + plot = bokeh_renderer.get_plot(overlay) + self.assertEqual(plot.state.yaxis[0].axis_label_text_font_size, '15pt') + self.assertEqual(plot.state.yaxis[1].axis_label_text_font_size, '13pt')