a2a-source-edit: write tests/test_agent.py

This commit is contained in:
a2a-cloud
2026-07-13 02:52:12 +00:00
parent 7f7591ebb0
commit 6ee2572897

View File

@@ -163,13 +163,13 @@ async def test_end_to_end_deterministic_crashing_image_scenario(ctx, workspace):
plan = await agent.plan_remediation(ctx, "checkout-001", "rollback the deployment to the previous image") plan = await agent.plan_remediation(ctx, "checkout-001", "rollback the deployment to the previous image")
assert any(step["action_type"] == "kubernetes.rollback_deployment" for step in plan["steps"]) assert any(step["action_type"] == "kubernetes.rollback_deployment" for step in plan["steps"])
denied = await agent.execute_remediation(ctx, "checkout-001", "outputs/incidents/checkout-001/remediation-plan.json", [plan.steps[0].id], "NO") denied = await agent.execute_remediation(ctx, "checkout-001", "outputs/incidents/checkout-001/remediation-plan.json", [plan["steps"][0]["id"]], "NO")
assert denied.status == "denied" assert denied.status == "denied"
dry = await agent.execute_remediation(ctx, "checkout-001", "outputs/incidents/checkout-001/remediation-plan.json", [plan.steps[0].id], APPROVAL_ACK) dry = await agent.execute_remediation(ctx, "checkout-001", "outputs/incidents/checkout-001/remediation-plan.json", [plan["steps"][0]["id"]], APPROVAL_ACK)
assert dry.status == "dry_run" assert dry.status == "dry_run"
executed = await agent.execute_remediation(ctx, "checkout-001", "outputs/incidents/checkout-001/remediation-plan.json", [plan.steps[0].id], APPROVAL_ACK, dry_run=False) executed = await agent.execute_remediation(ctx, "checkout-001", "outputs/incidents/checkout-001/remediation-plan.json", [plan["steps"][0]["id"]], APPROVAL_ACK, dry_run=False)
assert executed.status == "executed" assert executed.status == "executed"
verification = await agent.verify_recovery(ctx, "checkout-001", observation_seconds=0) verification = await agent.verify_recovery(ctx, "checkout-001", observation_seconds=0)