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

Function TestStructuredOutputGoldenErrorOutputAudit

cmd/json_contract_test.go:153–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

151}
152
153func TestStructuredOutputGoldenErrorOutputAudit(t *testing.T) {
154 fixtures := loadJSONGoldenErrorOutputs(t)
155 examples := jsonGoldenErrorOutputExamples()
156 schema := compileJSONSchemaFile(t, "../docs/json-schema/v1/error.schema.json")
157
158 for name, fixture := range fixtures {
159 if _, ok := examples[name]; !ok {
160 t.Errorf("golden error output includes unknown example %q", name)
161 }
162 if err := schema.Validate(decodeJSONValueForSchema(t, fixture)); err != nil {
163 t.Errorf("golden error output for %q does not validate: %v", name, err)
164 }
165 assertGoldenErrorOutputShape(t, name, fixture)
166 }
167 for name, example := range examples {
168 fixture, ok := fixtures[name]
169 if !ok {
170 t.Errorf("code-derived error output example %q has no golden output", name)
171 continue
172 }
173 assertGoldenJSONEqual(t, name, fixture, example)
174 }
175}
176
177func TestAccountAuthContractOmitsSensitiveFields(t *testing.T) {
178 example := jsonGoldenSuccessOutputExamples()["account"]

Callers

nothing calls this directly

Calls 6

compileJSONSchemaFileFunction · 0.85
decodeJSONValueForSchemaFunction · 0.85
assertGoldenJSONEqualFunction · 0.85

Tested by

no test coverage detected