@@ -203,16 +203,11 @@ class RequestHandlingTests(unittest.TestCase):
203203 def test_cloud_run_route_contracts_are_registered (self ):
204204 module = load_module ()
205205
206- self .assertIs (module .app ._routes [("/" , ("POST" , "GET" ))], module .handle_trigger )
207206 self .assertIs (module .app ._routes [("/run" , ("POST" , "GET" ))], module .handle_trigger )
208207 self .assertIs (
209208 module .app ._routes [("/backfill" , ("POST" , "GET" ))],
210209 module .handle_backfill ,
211210 )
212- self .assertIs (
213- module .app ._routes [("/precheck" , ("POST" , "GET" ))],
214- module .handle_precheck ,
215- )
216211 self .assertIs (
217212 module .app ._routes [("/dry-run" , ("POST" , "GET" ))],
218213 module .handle_dry_run ,
@@ -249,7 +244,7 @@ def fake_run_strategy():
249244 },
250245 clear = False ,
251246 ):
252- with module .app .test_request_context ("/" , method = "POST" ):
247+ with module .app .test_request_context ("/run " , method = "POST" ):
253248 body , status = module .handle_trigger ()
254249
255250 self .assertEqual (status , 200 )
@@ -260,7 +255,7 @@ def test_handle_trigger_returns_500_when_strategy_reports_failure(self):
260255 module = load_module ()
261256 module .run_strategy = lambda : False
262257
263- with module .app .test_request_context ("/" , method = "POST" ):
258+ with module .app .test_request_context ("/run " , method = "POST" ):
264259 body , status = module .handle_trigger ()
265260
266261 self .assertEqual (status , 500 )
@@ -282,7 +277,7 @@ def fake_post(_url, *, json, timeout):
282277 module .requests .post = fake_post
283278 module .run_strategy = lambda : (_ for _ in ()).throw (RuntimeError ("boom" ))
284279
285- with module .app .test_request_context ("/" , method = "POST" ):
280+ with module .app .test_request_context ("/run " , method = "POST" ):
286281 body , status = module .handle_trigger ()
287282
288283 self .assertEqual (status , 500 )
@@ -308,7 +303,7 @@ def fake_post(_url, *, json, timeout):
308303 module .requests .post = fake_post
309304 module .run_strategy = lambda : (_ for _ in ()).throw (RuntimeError ("boom" ))
310305
311- with module .app .test_request_context ("/" , method = "POST" ):
306+ with module .app .test_request_context ("/run " , method = "POST" ):
312307 body , status = module .handle_trigger ()
313308
314309 self .assertEqual (status , 500 )
@@ -327,7 +322,7 @@ def fake_run_strategy():
327322
328323 module .run_strategy = fake_run_strategy
329324
330- with module .app .test_request_context ("/" , method = "GET" ):
325+ with module .app .test_request_context ("/run " , method = "GET" ):
331326 body , status = module .handle_trigger ()
332327
333328 self .assertEqual (status , 200 )
@@ -351,27 +346,7 @@ def fake_run_strategy(*, force_run=False, validation_only=False, validation_labe
351346 self .assertEqual (body , "OK" )
352347 self .assertTrue (observed ["force_run" ])
353348 self .assertTrue (observed ["validation_only" ])
354- def test_handle_precheck_forces_strategy_run (self ):
355- module = load_module ()
356- observed = {"force_run" : None , "validation_only" : None }
357-
358- def fake_run_strategy (* , force_run = False , validation_only = False , validation_label = "backfill" ):
359- observed ["force_run" ] = force_run
360- observed ["validation_only" ] = validation_only
361- observed ["validation_label" ] = validation_label
362-
363- module .run_strategy = fake_run_strategy
364-
365- with module .app .test_request_context ("/precheck" , method = "POST" ):
366- body , status = module .handle_precheck ()
367-
368- self .assertEqual (status , 200 )
369- self .assertEqual (body , "Precheck OK" )
370- self .assertTrue (observed ["force_run" ])
371- self .assertTrue (observed ["validation_only" ])
372- self .assertEqual (observed ["validation_label" ], "precheck" )
373-
374- def test_handle_dry_run_alias_forces_strategy_dry_run (self ):
349+ def test_handle_dry_run_forces_strategy_dry_run (self ):
375350 module = load_module ()
376351 observed = {"force_run" : None , "validation_only" : None }
377352
@@ -389,7 +364,7 @@ def fake_run_strategy(*, force_run=False, validation_only=False, validation_labe
389364 self .assertEqual (body , "Dry Run OK" )
390365 self .assertTrue (observed ["force_run" ])
391366 self .assertTrue (observed ["validation_only" ])
392- self .assertEqual (observed ["validation_label" ], "precheck " )
367+ self .assertEqual (observed ["validation_label" ], "dry_run " )
393368
394369 def test_handle_probe_checks_account_snapshot_without_success_notification (self ):
395370 module = load_module ()
@@ -644,7 +619,7 @@ def build_rebalance_config(
644619 self .assertTrue (observed ["silent_cycle_notifications" ])
645620 self .assertEqual (observed ["notification_title_key" ], "" )
646621
647- def test_run_strategy_precheck_sets_precheck_notification_title (self ):
622+ def test_run_strategy_dry_run_sets_dry_run_notification_title (self ):
648623 module = load_module ()
649624 observed = {"notification_title_key" : None }
650625
@@ -685,9 +660,9 @@ def build_rebalance_config(
685660 module .is_market_open_now = lambda ** _kwargs : False
686661 module .run_rebalance_cycle = lambda ** _kwargs : None
687662
688- module .run_strategy (force_run = True , validation_only = True , validation_label = "precheck " )
663+ module .run_strategy (force_run = True , validation_only = True , validation_label = "dry_run " )
689664
690- self .assertEqual (observed ["notification_title_key" ], "precheck_title " )
665+ self .assertEqual (observed ["notification_title_key" ], "dry_run_title " )
691666
692667 def test_run_strategy_persists_machine_readable_report (self ):
693668 module = load_module ()
0 commit comments