Some checks failed
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Failing after 3m23s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 3s
Test Suite / compose-smoke (push) Has been skipped
Decision-Lock, Spec-D-Methoden und C1-Massstab-Vollspecs als Zielbild; Steering-Registry/Compat und Horizon-Tests an die Normierung anbinden. Implementierungsausreichendheit bleibt bewusst offen. Co-authored-by: Cursor <cursoragent@cursor.com>
98 lines
2.8 KiB
Python
98 lines
2.8 KiB
Python
"""AP2.3e — Method compatibility validation."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from tests.factories import provision_user_in_tenant
|
|
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
|
|
|
|
|
def test_update_method_queue_pull_on_support_queue_ok(client):
|
|
user = provision_user_in_tenant(tenant_role="member")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Queue Override",
|
|
archetype_key="initiative.support_queue",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
res = client.patch(
|
|
f"/api/steering/initiatives/{initiative_id}/context",
|
|
json={"method_key": "queue_pull"},
|
|
headers=_auth(token),
|
|
)
|
|
assert res.status_code == 200
|
|
assert res.json()["method_key"] == "queue_pull"
|
|
|
|
|
|
def test_update_method_queue_pull_on_linear_rejected(client):
|
|
user = provision_user_in_tenant(tenant_role="member")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Linear Override",
|
|
archetype_key="initiative.linear_project",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
res = client.patch(
|
|
f"/api/steering/initiatives/{initiative_id}/context",
|
|
json={"method_key": "queue_pull"},
|
|
headers=_auth(token),
|
|
)
|
|
assert res.status_code == 400
|
|
assert "kompatibel" in res.json()["detail"].lower()
|
|
|
|
|
|
def test_update_method_maturity_on_product_rejected(client):
|
|
user = provision_user_in_tenant(tenant_role="member")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Product Block",
|
|
archetype_key="initiative.product",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
res = client.patch(
|
|
f"/api/steering/initiatives/{initiative_id}/context",
|
|
json={"method_key": "maturity_progression"},
|
|
headers=_auth(token),
|
|
)
|
|
assert res.status_code == 400
|
|
assert "kompatibel" in res.json()["detail"].lower()
|
|
|
|
|
|
def test_operating_context_reflects_method_slice_intersection(client):
|
|
user = provision_user_in_tenant(tenant_role="member")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Queue Support",
|
|
archetype_key="initiative.support_queue",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
client.patch(
|
|
f"/api/steering/initiatives/{initiative_id}/context",
|
|
json={"method_key": "queue_pull"},
|
|
headers=_auth(token),
|
|
)
|
|
|
|
ctx = client.get(
|
|
f"/api/initiatives/{initiative_id}/operating-context",
|
|
headers=_auth(token),
|
|
)
|
|
assert ctx.status_code == 200
|
|
slices = ctx.json()["data_slices"]
|
|
assert "backlog" in slices
|
|
assert "work_cycles" not in slices
|