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

Function TestGetCurrentStep

pkg/executionplan/types_test.go:131–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

129}
130
131func TestGetCurrentStep(t *testing.T) {
132 plan := NewExecutionPlan("Test plan")
133 plan.AddStep("tool1", "Step 1", nil)
134 plan.AddStep("tool2", "Step 2", nil)
135
136 // Initially current step is 0
137 step := plan.GetCurrentStep()
138 if step == nil {
139 t.Fatal("expected non-nil current step")
140 }
141 if step.ToolName != "tool1" {
142 t.Errorf("expected tool1, got %q", step.ToolName)
143 }
144
145 // Change current step
146 plan.CurrentStep = 1
147 step = plan.GetCurrentStep()
148 if step.ToolName != "tool2" {
149 t.Errorf("expected tool2, got %q", step.ToolName)
150 }
151}
152
153func TestIsCompleted(t *testing.T) {
154 tests := []struct {

Callers

nothing calls this directly

Calls 3

AddStepMethod · 0.95
GetCurrentStepMethod · 0.95
NewExecutionPlanFunction · 0.85

Tested by

no test coverage detected