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

Function TestExecuteAlreadyExecuting

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

Source from the content-addressed store, hash-verified

501}
502
503func 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
523func TestExecuteAlreadyCompleted(t *testing.T) {
524 toolMap := map[string]tools.Tool{

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