MCPcopy Create free account
hub / github.com/algolia/cli / TestChangeApplicationPlan_Unauthorized

Function TestChangeApplicationPlan_Unauthorized

api/dashboard/client_test.go:510–525  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

508}
509
510func TestChangeApplicationPlan_Unauthorized(t *testing.T) {
511 mux := http.NewServeMux()
512 mux.HandleFunc(
513 "/1/applications/APP1/plan/self-serve",
514 func(w http.ResponseWriter, r *http.Request) {
515 w.WriteHeader(http.StatusUnauthorized)
516 },
517 )
518
519 ts, client := newTestClient(mux)
520 defer ts.Close()
521
522 _, err := client.ChangeApplicationPlan("expired-token", "APP1", "grow")
523 require.Error(t, err)
524 assert.Contains(t, err.Error(), "session expired")
525}
526
527func TestChangeApplicationPlan_ErrorStatus(t *testing.T) {
528 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 4

newTestClientFunction · 0.85
ChangeApplicationPlanMethod · 0.80
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected