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

Function TestNewExecutionPlan

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

Source from the content-addressed store, hash-verified

7)
8
9func TestNewExecutionPlan(t *testing.T) {
10 description := "Test plan description"
11 plan := NewExecutionPlan(description)
12
13 if plan == nil {
14 t.Fatal("NewExecutionPlan returned nil")
15 }
16
17 if plan.Description != description {
18 t.Errorf("expected description %q, got %q", description, plan.Description)
19 }
20
21 if plan.Status != StatusDraft {
22 t.Errorf("expected status %v, got %v", StatusDraft, plan.Status)
23 }
24
25 if plan.ID == "" {
26 t.Error("expected non-empty ID")
27 }
28
29 if len(plan.Steps) != 0 {
30 t.Errorf("expected 0 steps, got %d", len(plan.Steps))
31 }
32
33 if plan.Options == nil {
34 t.Error("expected non-nil Options")
35 }
36
37 if !plan.Options.RequireApproval {
38 t.Error("expected RequireApproval to be true by default")
39 }
40
41 if !plan.Options.StopOnError {
42 t.Error("expected StopOnError to be true by default")
43 }
44}
45
46func TestAddStep(t *testing.T) {
47 plan := NewExecutionPlan("Test plan")

Callers

nothing calls this directly

Calls 2

NewExecutionPlanFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected