Skip to content

Commit 09d0d56

Browse files
committed
add tests to ensure we can store non-serializable objects in client and tab storage
1 parent 509faa9 commit 09d0d56

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_storage.py

+20
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,23 @@ def f(v):
315315

316316
screen.open('/')
317317
screen.assert_py_logger('ERROR', 'app.storage.user can only be used within a UI context')
318+
319+
320+
def test_client_storage_holds_non_serializable_objects(screen: Screen):
321+
@ui.page('/')
322+
def page():
323+
ui.button('Update storage', on_click=lambda: app.storage.client.update(x=len))
324+
325+
screen.open('/')
326+
screen.click('Update storage')
327+
screen.wait(0.5)
328+
329+
330+
def test_tab_storage_holds_non_serializable_objects(screen: Screen):
331+
@ui.page('/')
332+
def page():
333+
ui.button('Update storage', on_click=lambda: app.storage.tab.update(x=len))
334+
335+
screen.open('/')
336+
screen.click('Update storage')
337+
screen.wait(0.5)

0 commit comments

Comments
 (0)