From 95b743d6fd64b561272ca67ac040cea7ab59e9db Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 10 Jul 2026 10:56:26 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20AP2.0=20pytest=20=E2=80=94=20Snapshot=20?= =?UTF-8?q?statt=20nicht=20vorhandenem=20GET=20context.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steering PATCH akzeptiert alle registrierten method_keys (nicht nur Legacy-Literal). Co-authored-by: Cursor --- backend/routers/steering.py | 6 ++---- backend/tests/test_ap20_steering_archetypes.py | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/routers/steering.py b/backend/routers/steering.py index e8d86a4..5442e21 100644 --- a/backend/routers/steering.py +++ b/backend/routers/steering.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Literal, Optional +from typing import Optional from capabilities import require_capability from fastapi import APIRouter, Depends, HTTPException @@ -17,9 +17,7 @@ router = APIRouter(prefix="/api/steering", tags=["steering"]) class SteeringContextUpdateRequest(BaseModel): - method_key: Optional[ - Literal["generic_operating", "product_milestone_driven"] - ] = None + method_key: str = Field(..., min_length=1) @router.get("/methods") diff --git a/backend/tests/test_ap20_steering_archetypes.py b/backend/tests/test_ap20_steering_archetypes.py index e1607aa..c7490a0 100644 --- a/backend/tests/test_ap20_steering_archetypes.py +++ b/backend/tests/test_ap20_steering_archetypes.py @@ -57,12 +57,12 @@ def test_program_initiative_gets_program_delivery_method(client): assert created.status_code == 201 initiative_id = created.json()["id"] - ctx = client.get( - f"/api/steering/initiatives/{initiative_id}/context", + snap = client.get( + f"/api/initiatives/{initiative_id}/steering-snapshot", headers=_auth(token), ) - assert ctx.status_code == 200 - assert ctx.json()["method_key"] == "program_delivery" + assert snap.status_code == 200 + assert snap.json()["method_key"] == "program_delivery" def test_project_inherits_mirror_archetype(client):