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

Function TestGetApplication_ParsesPlanLabel

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

Source from the content-addressed store, hash-verified

247}
248
249func TestGetApplication_ParsesPlanLabel(t *testing.T) {
250 mux := http.NewServeMux()
251 mux.HandleFunc("/1/application/APP1", func(w http.ResponseWriter, _ *http.Request) {
252 _, err := w.Write([]byte(
253 `{"data":{"id":"APP1","type":"application","attributes":{"name":"My App","application_id":"APP1","plan":{"name":"v8.5-plg-grow-plus","version":9,"label":"Grow Plus","pay_as_you_go":true}}}}`,
254 ))
255 require.NoError(t, err)
256 })
257
258 ts, client := newTestClient(mux)
259 defer ts.Close()
260
261 app, err := client.GetApplication("test-token", "APP1")
262 require.NoError(t, err)
263 assert.Equal(t, "Grow Plus", app.PlanLabel)
264}
265
266func TestCreateApplication_Success(t *testing.T) {
267 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 3

newTestClientFunction · 0.85
GetApplicationMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected