MCPcopy Create free account
hub / github.com/astercloud/aster / TestExecuteAlreadyCompleted

Function TestExecuteAlreadyCompleted

pkg/executionplan/executor_test.go:523–541  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

521}
522
523func TestExecuteAlreadyCompleted(t *testing.T) {
524 toolMap := map[string]tools.Tool{
525 "tool1": newMockTool("tool1", "result1", nil),
526 }
527
528 executor := NewExecutor(toolMap)
529
530 plan := NewExecutionPlan("Already completed test")
531 plan.AddStep("tool1", "Step 1", nil)
532 plan.Status = StatusCompleted
533
534 ctx := context.Background()
535 toolCtx := &tools.ToolContext{AgentID: "test-agent"}
536
537 err := executor.Execute(ctx, plan, toolCtx)
538 if err == nil {
539 t.Fatal("expected error for already completed plan")
540 }
541}
542
543func TestResume(t *testing.T) {
544 tool1 := newMockTool("tool1", "result1", nil)

Callers

nothing calls this directly

Calls 5

AddStepMethod · 0.95
ExecuteMethod · 0.95
newMockToolFunction · 0.85
NewExecutionPlanFunction · 0.85
NewExecutorFunction · 0.70

Tested by

no test coverage detected