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

Function assertGoldenErrorOutputShape

cmd/json_contract_test.go:670–695  ·  view source on GitHub ↗
(t *testing.T, name string, fixture json.RawMessage)

Source from the content-addressed store, hash-verified

668}
669
670func assertGoldenErrorOutputShape(t *testing.T, name string, fixture json.RawMessage) {
671 t.Helper()
672
673 var got jsonErrorResponse
674 if err := json.Unmarshal(fixture, &got); err != nil {
675 t.Fatalf("decode golden error output for %q: %v", name, err)
676 }
677 if got.OK {
678 t.Errorf("golden error output for %q has ok=true", name)
679 }
680 if got.SchemaVersion != jsonSchemaVersion {
681 t.Errorf("golden error output for %q schema_version = %q, want %q", name, got.SchemaVersion, jsonSchemaVersion)
682 }
683 if got.Command == "" {
684 t.Errorf("golden error output for %q has empty command", name)
685 }
686 if got.Error.Message == "" {
687 t.Errorf("golden error output for %q has empty error.message", name)
688 }
689 if got.Error.Code == "" {
690 t.Errorf("golden error output for %q has empty error.code", name)
691 }
692 if got.Warnings == nil {
693 t.Errorf("golden error output for %q has nil warnings; want [] when empty", name)
694 }
695}
696
697func jsonGoldenSuccessOutputExamples() map[string]jsonOperationOutput {
698 file := sampleJSONFileMetadata("/Reports/old.pdf")

Calls

no outgoing calls

Tested by

no test coverage detected