File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -511,3 +511,22 @@ def on_nested_click(n_clicks):
511
511
512
512
dash_duo .wait_for_element ("#nested" ).click ()
513
513
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"
You can’t perform that action at this time.
0 commit comments