|
| 1 | +import json |
| 2 | +import subprocess |
| 3 | +import sys |
| 4 | +from pathlib import Path |
| 5 | + |
1 | 6 | import pytest |
2 | 7 |
|
3 | 8 | from runtime_config_support import ( |
|
19 | 24 | '{"groups":{"default":{"ib_gateway_instance_name":"ib-gateway",' |
20 | 25 | '"ib_gateway_mode":"paper","ib_client_id":1}}}' |
21 | 26 | ) |
| 27 | +SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "print_strategy_profile_status.py" |
22 | 28 |
|
23 | 29 |
|
24 | 30 | def test_load_platform_runtime_settings_requires_strategy_profile(monkeypatch): |
@@ -208,6 +214,31 @@ def test_platform_profile_status_matrix_matches_current_ibkr_rollout(): |
208 | 214 | assert by_profile["semiconductor_rotation_income"]["enabled"] is True |
209 | 215 |
|
210 | 216 |
|
| 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 | + |
211 | 242 |
|
212 | 243 | def test_load_platform_runtime_settings_reads_feature_snapshot_path(monkeypatch): |
213 | 244 | monkeypatch.setenv("STRATEGY_PROFILE", "russell_1000_multi_factor_defensive") |
|
0 commit comments