MCPcopy Create free account
hub / github.com/dropbox/dbxcli / decodeRestoreOutput

Function decodeRestoreOutput

cmd/restore_test.go:301–318  ·  view source on GitHub ↗
(t *testing.T, stdout *bytes.Buffer)

Source from the content-addressed store, hash-verified

299}
300
301func decodeRestoreOutput(t *testing.T, stdout *bytes.Buffer) restoreOutput {
302 t.Helper()
303
304 var got restoreOutput
305 if err := json.Unmarshal(stdout.Bytes(), &got); err != nil {
306 t.Fatalf("decode JSON output: %v\noutput: %s", err, stdout.String())
307 }
308 if got.Warnings == nil {
309 t.Fatalf("warnings = nil, want empty array")
310 }
311 if len(got.Warnings) != 0 {
312 t.Fatalf("warnings = %+v, want empty", got.Warnings)
313 }
314 if len(got.Results) != 1 {
315 t.Fatalf("results len = %d, want 1", len(got.Results))
316 }
317 return got
318}

Calls

no outgoing calls

Tested by

no test coverage detected