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

This commit is contained in:
a2a-cloud
2026-07-13 02:51:32 +00:00
parent 788d083b18
commit 9f65f35381

View File

@@ -93,8 +93,8 @@ async def test_execute_requires_acknowledgement(ctx, workspace):
async def test_plan_never_executes_and_execution_dry_run_default(ctx, workspace): async def test_plan_never_executes_and_execution_dry_run_default(ctx, workspace):
agent = ProductionIncidentCommander() agent = ProductionIncidentCommander()
plan = await agent.plan_remediation(ctx, incident_id="inc-002", objective="rollback the bad image deployment") plan = await agent.plan_remediation(ctx, incident_id="inc-002", objective="rollback the bad image deployment")
assert plan.steps assert plan["steps"]
assert all(step.action_type != "shell" for step in plan.steps) assert all(step["action_type"] != "shell" for step in plan["steps"])
text = workspace.read_bytes("outputs/incidents/inc-002/remediation-plan.json").decode() text = workspace.read_bytes("outputs/incidents/inc-002/remediation-plan.json").decode()
assert "rollback" in text.lower() assert "rollback" in text.lower()
result = await agent.execute_remediation( result = await agent.execute_remediation(