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

Function TestRun_DryRunDoesNotCallAPI

pkg/cmd/application/create/create_test.go:488–502  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

486}
487
488func TestRun_DryRunDoesNotCallAPI(t *testing.T) {
489 srv := newServer(t, `{"has_payment_method": true}`)
490 defer srv.Close()
491
492 opts, out, _ := newOpts(t, srv, false)
493 opts.Plan = "grow"
494 opts.DryRun = true
495 opts.PrintFlags = newPrintFlags("")
496
497 require.NoError(t, runCreateCmd(context.Background(), opts))
498 assert.Equal(t, 0, srv.createCalls)
499 assert.Equal(t, 0, srv.patchCalls)
500 assert.Contains(t, out.String(), "Dry run")
501 assert.Contains(t, out.String(), "grow")
502}
503
504func TestRun_PlanChangeFailureKeepsFreeApp(t *testing.T) {
505 srv := newServer(t, `{"has_payment_method": true}`)

Callers

nothing calls this directly

Calls 6

newServerFunction · 0.70
newOptsFunction · 0.70
newPrintFlagsFunction · 0.70
runCreateCmdFunction · 0.70
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected