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

Function TestInitDbxRejectsUnsupportedStructuredOutputBeforeAuth

cmd/root_test.go:335–351  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

333}
334
335func TestInitDbxRejectsUnsupportedStructuredOutputBeforeAuth(t *testing.T) {
336 t.Setenv(envAccessToken, "")
337 t.Setenv(envAuthFile, filepath.Join(t.TempDir(), "missing-auth.json"))
338
339 cmd := newAuthTestCommand()
340 if err := cmd.Root().PersistentFlags().Set(outputFlag, "json"); err != nil {
341 t.Fatal(err)
342 }
343
344 err := initDbx(cmd, nil)
345 if err == nil {
346 t.Fatal("expected unsupported structured output to fail")
347 }
348 if !strings.Contains(err.Error(), "structured output is not supported") {
349 t.Fatalf("error = %q, want structured output error", err.Error())
350 }
351}
352
353func TestCompletionJSONUnsupportedOutputReturnsError(t *testing.T) {
354 t.Setenv(envAccessToken, "")

Callers

nothing calls this directly

Calls 3

newAuthTestCommandFunction · 0.85
initDbxFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected