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

Function TestValidateOutputFormatRejectsInvalidValue

cmd/output_test.go:136–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

134}
135
136func TestValidateOutputFormatRejectsInvalidValue(t *testing.T) {
137 cmd := &cobra.Command{}
138 cmd.Flags().String(outputFlag, "yaml", "")
139
140 err := validateOutputFormat(cmd)
141 if err == nil {
142 t.Fatal("expected invalid output format to fail")
143 }
144 if !strings.Contains(err.Error(), `unsupported output format "yaml": use text or json`) {
145 t.Fatalf("error = %q, want unsupported output format", err.Error())
146 }
147}
148
149func TestValidateOutputFormatRejectsUnsupportedJSONCommand(t *testing.T) {
150 cmd := &cobra.Command{}

Callers

nothing calls this directly

Calls 2

validateOutputFormatFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected