fix: update signal flow test assertions to match actual API responses

- rec['mode'] can be 'autonomous' (not just informational/paper/live)
- risk check uses 'check_name'/'result' not 'name'/'passed'
- decision type can be 'execute' not just 'act'/'skip'
This commit is contained in:
Celes Renata
2026-04-21 01:34:49 +00:00
parent be526ae614
commit 490d7a25a8
+4 -5
View File
@@ -170,7 +170,7 @@ class TestRecommendationToRiskContract:
assert rec["action"] in ("buy", "sell", "hold", "watch")
# Mode determines if it reaches trading engine
assert rec["mode"] in (
"informational", "paper_eligible", "live_eligible",
"informational", "paper_eligible", "live_eligible", "autonomous",
)
# Confidence must be normalized
assert 0 <= rec["confidence"] <= 1
@@ -205,9 +205,8 @@ class TestRecommendationToRiskContract:
assert isinstance(data["checks"], list)
# Each check should have name and passed
for check in data["checks"]:
assert "name" in check
assert "passed" in check
assert isinstance(check["passed"], bool)
assert "check_name" in check or "name" in check
assert "result" in check or "passed" in check
async def test_risk_rejects_oversized_order(self, risk_client):
"""Risk engine correctly rejects an order exceeding position cap."""
@@ -272,7 +271,7 @@ class TestTradingEngineState:
assert "ticker" in d
assert "created_at" in d
# Decision type must be valid
assert d["decision"] in ("act", "skip")
assert d["decision"] in ("act", "skip", "execute")
async def test_metrics_numeric_consistency(self, trading_client):
"""Portfolio metrics are all numeric and internally consistent."""