From ef41622a801edcea27ad146bf515acf09926147e Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sat, 27 Jun 2026 05:20:26 +0800 Subject: [PATCH] Fix CI: align tests with cash-only execution defaults. Co-authored-by: Cursor --- tests/test_notifications_telegram.py | 2 +- tests/test_rebalance_service.py | 1 + tests/test_runtime_broker_adapters.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_notifications_telegram.py b/tests/test_notifications_telegram.py index 6156b2e..04efe9c 100644 --- a/tests/test_notifications_telegram.py +++ b/tests/test_notifications_telegram.py @@ -41,7 +41,7 @@ def test_render_cycle_summary_dashboard_text_does_not_hide_account_overview(): ) assert " - Total assets: $2,345.67" in message - assert " - Buying power: $456.78" in message + assert " - Available cash: $456.78" in message assert " - Reserved cash: $50.00" in message assert " - Investable cash: $406.78" in message assert " - SOXL: $1,000.00 / 5 shares" in message diff --git a/tests/test_rebalance_service.py b/tests/test_rebalance_service.py index 5b732b8..c05eca1 100644 --- a/tests/test_rebalance_service.py +++ b/tests/test_rebalance_service.py @@ -59,6 +59,7 @@ def test_runtime_metadata_uses_platform_execution_policy_over_strategy_metadata( "firstrade_execution_policy": { "reserved_cash_floor_usd": 250.0, "reserved_cash_ratio": 0.03, + "cash_only_execution": True, }, } diff --git a/tests/test_runtime_broker_adapters.py b/tests/test_runtime_broker_adapters.py index 4a0bfae..f361929 100644 --- a/tests/test_runtime_broker_adapters.py +++ b/tests/test_runtime_broker_adapters.py @@ -61,9 +61,9 @@ def get_balances(self, _account): portfolio = adapters.build_portfolio_port().get_portfolio_snapshot() - assert portfolio.total_equity == 1234.56 + assert portfolio.total_equity == 221.0 assert portfolio.cash_balance == 200.0 - assert portfolio.metadata["total_equity_source"] == "balance_total" + assert portfolio.metadata["total_equity_source"] == "cash_plus_positions" def test_managed_portfolio_snapshot_ignores_full_account_value_balance_key():