Skip to content

Commit 15aeb7f

Browse files
committed
Add IBKR status script smoke tests
1 parent a9612c2 commit 15aeb7f

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

tests/test_runtime_config_support.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import json
2+
import subprocess
3+
import sys
4+
from pathlib import Path
5+
16
import pytest
27

38
from runtime_config_support import (
@@ -19,6 +24,7 @@
1924
'{"groups":{"default":{"ib_gateway_instance_name":"ib-gateway",'
2025
'"ib_gateway_mode":"paper","ib_client_id":1}}}'
2126
)
27+
SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "print_strategy_profile_status.py"
2228

2329

2430
def test_load_platform_runtime_settings_requires_strategy_profile(monkeypatch):
@@ -208,6 +214,31 @@ def test_platform_profile_status_matrix_matches_current_ibkr_rollout():
208214
assert by_profile["semiconductor_rotation_income"]["enabled"] is True
209215

210216

217+
def test_print_strategy_profile_status_json_matches_registry():
218+
result = subprocess.run(
219+
[sys.executable, str(SCRIPT_PATH), "--json"],
220+
check=True,
221+
capture_output=True,
222+
text=True,
223+
)
224+
225+
assert json.loads(result.stdout) == get_platform_profile_status_matrix()
226+
227+
228+
def test_print_strategy_profile_status_table_contains_expected_headers():
229+
result = subprocess.run(
230+
[sys.executable, str(SCRIPT_PATH)],
231+
check=True,
232+
capture_output=True,
233+
text=True,
234+
)
235+
236+
assert "canonical_profile" in result.stdout
237+
assert "display_name" in result.stdout
238+
assert "global_etf_rotation" in result.stdout
239+
assert "QQQ Tech Enhancement" in result.stdout
240+
241+
211242

212243
def test_load_platform_runtime_settings_reads_feature_snapshot_path(monkeypatch):
213244
monkeypatch.setenv("STRATEGY_PROFILE", "russell_1000_multi_factor_defensive")

0 commit comments

Comments
 (0)