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

Function TestExecuteToolNotFound

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

Source from the content-addressed store, hash-verified

477}
478
479func TestExecuteToolNotFound(t *testing.T) {
480 toolMap := map[string]tools.Tool{
481 "tool1": newMockTool("tool1", "result1", nil),
482 }
483
484 executor := NewExecutor(toolMap)
485
486 plan := NewExecutionPlan("Tool not found test")
487 plan.AddStep("nonexistent_tool", "Step 1", nil)
488 plan.Options.RequireApproval = false
489
490 ctx := context.Background()
491 toolCtx := &tools.ToolContext{AgentID: "test-agent"}
492
493 err := executor.Execute(ctx, plan, toolCtx)
494 if err == nil {
495 t.Fatal("expected error for nonexistent tool")
496 }
497
498 if plan.Steps[0].Status != StepStatusFailed {
499 t.Errorf("expected step status %v, got %v", StepStatusFailed, plan.Steps[0].Status)
500 }
501}
502
503func TestExecuteAlreadyExecuting(t *testing.T) {
504 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