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

Function Test_runUpdateCmd_dryRunJSON

pkg/cmd/objects/update/update_test.go:120–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

118}
119
120func Test_runUpdateCmd_dryRunJSON(t *testing.T) {
121 r := httpmock.Registry{}
122 f, out := test.NewFactory(false, &r, nil, `{"objectID":"foo"}`)
123 cmd := NewUpdateCmd(f, nil)
124
125 out, err := test.Execute(cmd, "foo -F - --dry-run --output json", out)
126 if err != nil {
127 t.Fatal(err)
128 }
129
130 assert.Contains(t, out.String(), `"action":"update_objects"`)
131 assert.Contains(t, out.String(), `"objectCount":1`)
132 assert.Contains(t, out.String(), `"dryRun":true`)
133}

Callers

nothing calls this directly

Calls 4

NewFactoryFunction · 0.92
ExecuteFunction · 0.92
NewUpdateCmdFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected