Download this file
| 1 | package adopt |
| 2 | |
| 3 | import ( |
| 4 | "amadan.net/oficina/alta/provision" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestEquipoAdoptionDelivery(t *testing.T) { |
| 9 | app, ok := provision.AppBySlug("equipo") |
| 10 | if !ok { |
| 11 | t.Fatal("Equipo missing") |
| 12 | } |
| 13 | if AgentKeys(app) != ([2]string{"EQUIPO_AGENT_ISSUER", "EQUIPO_AGENT_TEAM"}) { |
| 14 | t.Fatal("wrong Equipo agent keys") |
| 15 | } |
| 16 | if BaselineOps(app) != OpsApp401 { |
| 17 | t.Fatal("Equipo baseline is its API's own 401") |
| 18 | } |
| 19 | before := Delivery{Version: "v1.0.0", Header: "v1.0.0", Health: 200, Ops: OpsApp401} |
| 20 | after := before |
| 21 | after.Ops = OpsAgent401 |
| 22 | if err := Delivered(app, before, after); err != nil { |
| 23 | t.Fatal(err) |
| 24 | } |
| 25 | for _, shape := range []OpsShape{OpsApp401, OpsAbsent, OpsAgent200, OpsOther} { |
| 26 | after.Ops = shape |
| 27 | if Delivered(app, before, after) == nil { |
| 28 | t.Fatalf("Equipo delivered with %s", shape) |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |