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

Function TestIsCompleted

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

Source from the content-addressed store, hash-verified

151}
152
153func TestIsCompleted(t *testing.T) {
154 tests := []struct {
155 name string
156 status Status
157 expected bool
158 }{
159 {"draft", StatusDraft, false},
160 {"pending approval", StatusPendingApproval, false},
161 {"approved", StatusApproved, false},
162 {"executing", StatusExecuting, false},
163 {"completed", StatusCompleted, true},
164 {"failed", StatusFailed, true},
165 {"canceled", StatusCancelled, true},
166 {"partial", StatusPartial, false},
167 }
168
169 for _, tt := range tests {
170 t.Run(tt.name, func(t *testing.T) {
171 plan := NewExecutionPlan("Test")
172 plan.Status = tt.status
173 if plan.IsCompleted() != tt.expected {
174 t.Errorf("expected %v, got %v", tt.expected, plan.IsCompleted())
175 }
176 })
177 }
178}
179
180func TestIsApproved(t *testing.T) {
181 tests := []struct {

Callers

nothing calls this directly

Calls 3

IsCompletedMethod · 0.95
NewExecutionPlanFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected