(t *testing.T)
| 501 | } |
| 502 | |
| 503 | func TestExecuteAlreadyExecuting(t *testing.T) { |
| 504 | toolMap := map[string]tools.Tool{ |
| 505 | "tool1": newMockTool("tool1", "result1", nil), |
| 506 | } |
| 507 | |
| 508 | executor := NewExecutor(toolMap) |
| 509 | |
| 510 | plan := NewExecutionPlan("Already executing test") |
| 511 | plan.AddStep("tool1", "Step 1", nil) |
| 512 | plan.Status = StatusExecuting |
| 513 | |
| 514 | ctx := context.Background() |
| 515 | toolCtx := &tools.ToolContext{AgentID: "test-agent"} |
| 516 | |
| 517 | err := executor.Execute(ctx, plan, toolCtx) |
| 518 | if err == nil { |
| 519 | t.Fatal("expected error for already executing plan") |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | func TestExecuteAlreadyCompleted(t *testing.T) { |
| 524 | toolMap := map[string]tools.Tool{ |
nothing calls this directly
no test coverage detected