Skip to content

Commit 3ab52cd

Browse files
wilhelmhbalexcjohnson
authored andcommitted
Add tests
1 parent 35f35e6 commit 3ab52cd

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

tests/integration/test_integration.py

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -647,36 +647,46 @@ def update_output(value):
647647
def test_inin019_callback_dep_types():
648648
app = Dash(__name__)
649649
app.layout = html.Div(
650-
[html.Div("child", id="in"), html.Div("state", id="state"), html.Div(id="out")]
650+
[html.Div("child", id="in1"), html.Div("state", id="state1"), html.Div(id="out1"),
651+
html.Div("child", id="in2"), html.Div("state", id="state2"), html.Div(id="out2"),
652+
html.Div("child", id="in3"), html.Div("state", id="state3"), html.Div(id="out3"),
653+
]
651654
)
652655

653656
with pytest.raises(IncorrectTypeException):
654657

655-
@app.callback([[Output("out", "children")]], [Input("in", "children")])
658+
@app.callback([[Output("out1", "children")]],
659+
[Input("in1", "children")])
656660
def f(i):
657661
return i
658662

659663
pytest.fail("extra output nesting")
660664

661-
with pytest.raises(IncorrectTypeException):
662-
663-
@app.callback(
664-
Output("out", "children"),
665-
[Input("in", "children")],
666-
State("state", "children"),
667-
)
668-
def f3(i):
669-
return i
665+
# all OK with tuples
666+
@app.callback(
667+
(Output("out1", "children"),),
668+
(Input("in1", "children"),),
669+
(State("state1", "children"),),
670+
)
671+
def f1(i):
672+
return i
670673

671-
pytest.fail("un-nested state")
674+
# all OK with all args in single list
675+
@app.callback(
676+
Output("out2", "children"),
677+
Input("in2", "children"),
678+
State("state2", "children"),
679+
)
680+
def f2(i):
681+
return i
672682

673-
# all OK with tuples
683+
# all OK with lists
674684
@app.callback(
675-
(Output("out", "children"),),
676-
(Input("in", "children"),),
677-
(State("state", "children"),),
685+
[Output("out3", "children")],
686+
[Input("in3", "children")],
687+
[State("state3", "children")],
678688
)
679-
def f4(i):
689+
def f3(i):
680690
return i
681691

682692

0 commit comments

Comments
 (0)