(t *testing.T)
| 654 | } |
| 655 | |
| 656 | func TestJSONErrorDetailsIncludesAuthRemediation(t *testing.T) { |
| 657 | got := newJSONErrorResponse(&cobra.Command{Use: "account"}, missingAccessTokenError(tokenPersonal)) |
| 658 | |
| 659 | if got.Error.Code != jsonErrorCodeAuthRequired { |
| 660 | t.Fatalf("code = %q, want %q", got.Error.Code, jsonErrorCodeAuthRequired) |
| 661 | } |
| 662 | for key, want := range map[string]any{ |
| 663 | "token_type": tokenPersonal, |
| 664 | "login_command": "dbxcli login", |
| 665 | "env_var": envAccessToken, |
| 666 | } { |
| 667 | if got.Error.Details[key] != want { |
| 668 | t.Fatalf("details = %+v, want %s=%v", got.Error.Details, key, want) |
| 669 | } |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | func TestRenderCommandErrorWritesUnsupportedStructuredOutputAsJSON(t *testing.T) { |
| 674 | var stdout bytes.Buffer |
nothing calls this directly
no test coverage detected