Skip to content

Commit 51c6a21

Browse files
committed
add test
1 parent c69a167 commit 51c6a21

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/integration/test_integration.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,3 +511,22 @@ def on_nested_click(n_clicks):
511511

512512
dash_duo.wait_for_element("#nested").click()
513513
dash_duo.wait_for_text_to_equal("#nested-output", "Clicked 1 times")
514+
515+
516+
def test_inin030_add_startup_route(dash_duo):
517+
url = "my-new-route"
518+
def my_route_f():
519+
return "hello"
520+
Dash.add_startup_route(url, my_route_f, ["POST"])
521+
522+
import requests
523+
524+
app = Dash(__name__)
525+
Dash.STARTUP_ROUTES = []
526+
app.layout = html.Div("Hello World")
527+
dash_duo.start_server(app)
528+
529+
url = f"{dash_duo.server_url}{app.config.requests_pathname_prefix}_dash_startup_route/{url}"
530+
response = requests.post(url)
531+
assert response.status_code == 200
532+
assert response.text == "hello"

0 commit comments

Comments
 (0)