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

Function TestUpdateApplication_Unauthorized

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

Source from the content-addressed store, hash-verified

322}
323
324func TestUpdateApplication_Unauthorized(t *testing.T) {
325 mux := http.NewServeMux()
326 mux.HandleFunc("/1/applications/APP1", func(w http.ResponseWriter, r *http.Request) {
327 w.WriteHeader(http.StatusUnauthorized)
328 })
329
330 ts, client := newTestClient(mux)
331 defer ts.Close()
332
333 _, err := client.UpdateApplication("expired-token", "APP1", "Renamed App")
334 require.Error(t, err)
335 assert.Contains(t, err.Error(), "session expired")
336}
337
338func TestUpdateApplication_ErrorStatus(t *testing.T) {
339 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected