25 lines
987 B
Python
25 lines
987 B
Python
|
|
"""Integration tests for portfolio steering API — K-Ext-5."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from tests.factories import provision_user_in_tenant
|
||
|
|
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||
|
|
|
||
|
|
|
||
|
|
def test_workspace_steering_aggregates_kernel(client):
|
||
|
|
user = provision_user_in_tenant(tenant_role="member")
|
||
|
|
token = _login(client, user)
|
||
|
|
created = _create_initiative(client, token, title="Portfolio Kernel")
|
||
|
|
initiative_id = created.json()["id"]
|
||
|
|
|
||
|
|
res = client.get("/api/workspace/steering", headers=_auth(token))
|
||
|
|
assert res.status_code == 200
|
||
|
|
body = res.json()
|
||
|
|
assert body["data_source"] == "steering_kernel_portfolio_v0.1"
|
||
|
|
assert body["initiative_count"] >= 1
|
||
|
|
assert isinstance(body["attention"], list)
|
||
|
|
assert isinstance(body["next_work"], list)
|
||
|
|
assert isinstance(body["proposals_summary"], list)
|
||
|
|
assert isinstance(body["agent_slots"], list)
|
||
|
|
assert initiative_id in body["attention_by_initiative"]
|