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

Function TestStructuredOutputSupportDoesNotInheritFromParent

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

Source from the content-addressed store, hash-verified

180}
181
182func TestStructuredOutputSupportDoesNotInheritFromParent(t *testing.T) {
183 root := &cobra.Command{}
184 root.PersistentFlags().String(outputFlag, "json", "")
185 enableStructuredOutput(root)
186
187 cmd := &cobra.Command{}
188 root.AddCommand(cmd)
189
190 err := validateOutputFormat(cmd)
191 if !errors.Is(err, output.ErrStructuredOutputUnsupported) {
192 t.Fatalf("error = %v, want ErrStructuredOutputUnsupported", err)
193 }
194}
195
196func TestRootCommandDefinesOutputFlag(t *testing.T) {
197 flag := RootCmd.PersistentFlags().Lookup(outputFlag)

Callers

nothing calls this directly

Calls 2

enableStructuredOutputFunction · 0.85
validateOutputFormatFunction · 0.85

Tested by

no test coverage detected