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

Function decodeRelocationOutput

cmd/cp_test.go:566–585  ·  view source on GitHub ↗
(t *testing.T, data []byte)

Source from the content-addressed store, hash-verified

564}
565
566func decodeRelocationOutput(t *testing.T, data []byte) relocationOutput {
567 t.Helper()
568 var got relocationOutput
569 if err := json.Unmarshal(data, &got); err != nil {
570 t.Fatalf("decode JSON output: %v\noutput: %s", err, string(data))
571 }
572 if got.Input == nil {
573 t.Fatalf("input = nil, want empty object")
574 }
575 if len(got.Input) != 0 {
576 t.Fatalf("input = %+v, want empty object", got.Input)
577 }
578 if got.Warnings == nil {
579 t.Fatalf("warnings = nil, want empty array")
580 }
581 if len(got.Warnings) != 0 {
582 t.Fatalf("warnings = %+v, want empty", got.Warnings)
583 }
584 return got
585}
586
587func relocationTestFileMetadata(pathDisplay string, size uint64) *files.FileMetadata {
588 metadata := files.NewFileMetadata(path.Base(pathDisplay), "id:"+path.Base(pathDisplay), dropbox.DBXTime(time.Time{}), dropbox.DBXTime(time.Time{}), "rev", size)

Calls

no outgoing calls

Tested by

no test coverage detected