MCPcopy
hub / github.com/plotly/dash / test_002ab_basic

Function test_002ab_basic

tests/async_tests/test_async_background_callbacks.py:41–63  ·  view source on GitHub ↗

Make sure that we settle to the correct final value when handling rapid inputs

(dash_duo, manager)

Source from the content-addressed store, hash-verified

39)
40@flaky(max_runs=3)
41def test_002ab_basic(dash_duo, manager):
42 """
43 Make sure that we settle to the correct final value when handling rapid inputs
44 """
45 if not is_dash_async():
46 return
47 lock = Lock()
48 with setup_background_callback_app(manager, "app1_async") as app:
49 dash_duo.start_server(app)
50 dash_duo.wait_for_text_to_equal("#output-1", "initial value", 15)
51 input_ = dash_duo.find_element("#input")
52 # pause for sync
53 time.sleep(0.2)
54 dash_duo.clear_input(input_)
55
56 for key in "hello world":
57 with lock:
58 input_.send_keys(key)
59
60 dash_duo.wait_for_text_to_equal("#output-1", "hello world", 8)
61
62 assert not dash_duo.redux_state_is_loading
63 assert dash_duo.get_logs() == []

Callers

nothing calls this directly

Calls 8

is_dash_asyncFunction · 0.90
find_elementMethod · 0.80
clear_inputMethod · 0.80
send_keysMethod · 0.80
get_logsMethod · 0.80
start_serverMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…