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

Function TestApprove

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

Source from the content-addressed store, hash-verified

237}
238
239func TestApprove(t *testing.T) {
240 plan := NewExecutionPlan("Test plan")
241 approvedBy := "user@example.com"
242
243 plan.Approve(approvedBy)
244
245 if !plan.UserApproved {
246 t.Error("expected UserApproved to be true")
247 }
248
249 if plan.ApprovedBy != approvedBy {
250 t.Errorf("expected ApprovedBy %q, got %q", approvedBy, plan.ApprovedBy)
251 }
252
253 if plan.ApprovedAt == nil {
254 t.Error("expected ApprovedAt to be set")
255 }
256
257 if plan.Status != StatusApproved {
258 t.Errorf("expected status %v, got %v", StatusApproved, plan.Status)
259 }
260}
261
262func TestReject(t *testing.T) {
263 plan := NewExecutionPlan("Test plan")

Callers

nothing calls this directly

Calls 3

ApproveMethod · 0.95
NewExecutionPlanFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected