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

Function TestRevsJSONErrorWritesNoOutput

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

Source from the content-addressed store, hash-verified

164}
165
166func TestRevsJSONErrorWritesNoOutput(t *testing.T) {
167 cmd, stdout := testRevsCmd()
168 setRevsOutputJSON(t, cmd)
169
170 stubFilesClient(t, &mockFilesClient{
171 listRevisionsFn: func(arg *files.ListRevisionsArg) (*files.ListRevisionsResult, error) {
172 return nil, fmt.Errorf("revs failed")
173 },
174 })
175
176 if err := revs(cmd, []string{"/report.pdf"}); err == nil {
177 t.Fatal("expected revs error")
178 }
179 if got := stdout.String(); got != "" {
180 t.Fatalf("stdout = %q, want empty output on error", got)
181 }
182}
183
184func TestRevsRejectsInvalidListOptions(t *testing.T) {
185 tests := []struct {

Callers

nothing calls this directly

Calls 4

testRevsCmdFunction · 0.85
setRevsOutputJSONFunction · 0.85
stubFilesClientFunction · 0.85
revsFunction · 0.85

Tested by

no test coverage detected