package adopt import ( "amadan.net/oficina/alta/provision" "testing" ) func TestEquipoAdoptionDelivery(t *testing.T) { app, ok := provision.AppBySlug("equipo") if !ok { t.Fatal("Equipo missing") } if AgentKeys(app) != ([2]string{"EQUIPO_AGENT_ISSUER", "EQUIPO_AGENT_TEAM"}) { t.Fatal("wrong Equipo agent keys") } if BaselineOps(app) != OpsApp401 { t.Fatal("Equipo baseline is its API's own 401") } before := Delivery{Version: "v1.0.0", Header: "v1.0.0", Health: 200, Ops: OpsApp401} after := before after.Ops = OpsAgent401 if err := Delivered(app, before, after); err != nil { t.Fatal(err) } for _, shape := range []OpsShape{OpsApp401, OpsAbsent, OpsAgent200, OpsOther} { after.Ops = shape if Delivered(app, before, after) == nil { t.Fatalf("Equipo delivered with %s", shape) } } }