@@ -528,7 +528,7 @@ def fake_dry_run(*, recycle_on_timeout, timeout_state):
528528
529529
530530def test_handle_probe_checks_account_snapshot_without_success_notification (strategy_module , monkeypatch ):
531- observed = {"events" : [], "disconnects" : 0 , "notifications" : []}
531+ observed = {"events" : [], "disconnects" : 0 , "notifications" : [], "connection_options" : [] }
532532
533533 class FakeIB :
534534 def disconnect (self ):
@@ -562,7 +562,11 @@ def disconnect(self):
562562 "attach_strategy_plugin_report" ,
563563 lambda * args , ** kwargs : (_ for _ in ()).throw (AssertionError ("health probe should not attach strategy plugin reports" )),
564564 )
565- monkeypatch .setattr (strategy_module , "connect_ib" , lambda : FakeIB ())
565+ def fake_connect_ib (* , validate_trading_permissions = True ):
566+ observed ["connection_options" ].append (validate_trading_permissions )
567+ return FakeIB ()
568+
569+ monkeypatch .setattr (strategy_module , "connect_ib" , fake_connect_ib )
566570 monkeypatch .setattr (strategy_module , "build_portfolio_snapshot" , lambda ib : snapshot )
567571 monkeypatch .setattr (
568572 strategy_module ,
@@ -585,6 +589,7 @@ def disconnect(self):
585589 assert observed ["report" ]["summary" ]["positions_count" ] == 1
586590 assert observed ["disconnects" ] == 1
587591 assert observed ["notifications" ] == []
592+ assert observed ["connection_options" ] == [False ]
588593
589594
590595def test_handle_probe_connect_timeout_sends_concise_connection_notification (strategy_module , monkeypatch ):
0 commit comments