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

Function TestAccountJSONErrorWritesNoOutput

cmd/account_test.go:158–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func TestAccountJSONErrorWritesNoOutput(t *testing.T) {
159 cmd, stdout := testAccountCmd()
160 setAccountOutputJSON(t, cmd)
161 stubUsersClient(t, &mockUsersClient{
162 getCurrentAccountFn: func() (*users.FullAccount, error) {
163 return nil, errors.New("account failed")
164 },
165 })
166
167 if err := account(cmd, nil); err == nil {
168 t.Fatal("expected account error")
169 }
170 if got := stdout.String(); got != "" {
171 t.Fatalf("stdout = %q, want empty output on error", got)
172 }
173}
174
175func TestAccountCommandSupportsStructuredOutput(t *testing.T) {
176 if !commandSupportsStructuredOutput(accountCmd) {

Callers

nothing calls this directly

Calls 4

testAccountCmdFunction · 0.85
setAccountOutputJSONFunction · 0.85
stubUsersClientFunction · 0.85
accountFunction · 0.85

Tested by

no test coverage detected