(t *testing.T)
| 239 | } |
| 240 | |
| 241 | func Test_runDeleteCmd_dryRunJSON(t *testing.T) { |
| 242 | r := httpmock.Registry{} |
| 243 | r.Register( |
| 244 | httpmock.REST("GET", "1/indexes/foo/1"), |
| 245 | httpmock.JSONResponse(search.GetObjectsResponse{}), |
| 246 | ) |
| 247 | |
| 248 | f, out := test.NewFactory(false, &r, nil, "") |
| 249 | cmd := NewDeleteCmd(f, nil) |
| 250 | out, err := test.Execute(cmd, "foo --object-ids 1 --dry-run --output json", out) |
| 251 | if err != nil { |
| 252 | t.Fatal(err) |
| 253 | } |
| 254 | |
| 255 | assert.Contains(t, out.String(), `"action":"delete_objects"`) |
| 256 | assert.Contains(t, out.String(), `"objectCount":1`) |
| 257 | assert.Contains(t, out.String(), `"dryRun":true`) |
| 258 | } |
nothing calls this directly
no test coverage detected