Skip to content

Commit ea4bf5c

Browse files
committed
test that tuples work for callback args
1 parent c3dd40a commit ea4bf5c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/integration/callbacks/test_validation.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,34 @@ def o2(i, s):
193193
dash_duo.start_server(app)
194194
dash_duo.wait_for_text_to_equal("#out1", "1: High")
195195
dash_duo.wait_for_text_to_equal("#out2", "2: High")
196+
197+
198+
def test_cbva005_tuple_args(dash_duo):
199+
app = Dash(__name__)
200+
app.layout = html.Div(
201+
[
202+
html.Div("Yo", id="in1"),
203+
html.Div("lo", id="in2"),
204+
html.Div(id="out1"),
205+
html.Div(id="out2"),
206+
]
207+
)
208+
209+
@app.callback(
210+
Output("out1", "children"),
211+
(Input("in1", "children"), Input("in2", "children"))
212+
)
213+
def f(i1, i2):
214+
return "1: " + i1 + i2
215+
216+
@app.callback(
217+
(Output("out2", "children"),),
218+
Input("in1", "children"),
219+
(State("in2", "children"),)
220+
)
221+
def g(i1, i2):
222+
return ("2: " + i1 + i2,)
223+
224+
dash_duo.start_server(app)
225+
dash_duo.wait_for_text_to_equal("#out1", "1: Yolo")
226+
dash_duo.wait_for_text_to_equal("#out2", "2: Yolo")

0 commit comments

Comments
 (0)