Skip to content

Commit

Permalink
Update server tests to simulate loaded event (#6157)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Mar 20, 2024
1 parent 0147837 commit dcef38a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions holoviews/tests/plotting/bokeh/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ def test_rangexy_framewise_reset(self):
self.assertEqual(stream.y_range, None)

def test_rangexy_framewise_not_reset_if_triggering(self):
import panel as pn
from packaging.version import Version
if Version(pn.__version__) == Version("1.4.0rc3"):
raise SkipTest('This test fails with Panel 1.4.0rc3')
stream = RangeXY(x_range=(0, 2), y_range=(0, 1))
curve = DynamicMap(lambda z, x_range, y_range: Curve([1, 2, z]),
kdims=['z'], streams=[stream]).redim.range(z=(0, 3))
Expand Down
6 changes: 6 additions & 0 deletions holoviews/tests/plotting/bokeh/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def test_server_dynamicmap_with_stream(self):

cds = session.document.roots[0].select_one({'type': ColumnDataSource})
self.assertEqual(cds.data['y'][2], 2)
def loaded():
state._schedule_on_load(doc, None)
doc.add_next_tick_callback(loaded)
def run():
stream.event(y=3)
doc.add_next_tick_callback(run)
Expand All @@ -180,6 +183,9 @@ def test_server_dynamicmap_with_stream_dims(self):

orig_cds = session.document.roots[0].select_one({'type': ColumnDataSource})
self.assertEqual(orig_cds.data['y'][2], 2)
def loaded():
state._schedule_on_load(doc, None)
doc.add_next_tick_callback(loaded)
def run():
stream.event(y=3)
doc.add_next_tick_callback(run)
Expand Down

0 comments on commit dcef38a

Please sign in to comment.