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

Function TestIsApproved

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

Source from the content-addressed store, hash-verified

178}
179
180func TestIsApproved(t *testing.T) {
181 tests := []struct {
182 name string
183 userApproved bool
184 autoApprove bool
185 expected bool
186 }{
187 {"not approved", false, false, false},
188 {"user approved", true, false, true},
189 {"auto approve", false, true, true},
190 {"both approved", true, true, true},
191 }
192
193 for _, tt := range tests {
194 t.Run(tt.name, func(t *testing.T) {
195 plan := NewExecutionPlan("Test")
196 plan.UserApproved = tt.userApproved
197 plan.Options.AutoApprove = tt.autoApprove
198 if plan.IsApproved() != tt.expected {
199 t.Errorf("expected %v, got %v", tt.expected, plan.IsApproved())
200 }
201 })
202 }
203}
204
205func TestCanExecute(t *testing.T) {
206 tests := []struct {

Callers

nothing calls this directly

Calls 3

IsApprovedMethod · 0.95
NewExecutionPlanFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected