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

Function TestGetJSONRejectsStdoutTarget

cmd/get_test.go:713–730  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

711}
712
713func TestGetJSONRejectsStdoutTarget(t *testing.T) {
714 var stdout bytes.Buffer
715 cmd := testGetJSONCmd(&stdout, nil)
716
717 err := get(cmd, []string{"/remote/file.txt", "-"})
718 if err == nil {
719 t.Fatal("expected JSON stdout target error")
720 }
721 if !strings.Contains(err.Error(), "stdout target") {
722 t.Fatalf("error = %q, want stdout target", err.Error())
723 }
724 if got, want := jsonErrorCode(err), jsonErrorCodeInvalidArguments; got != want {
725 t.Fatalf("jsonErrorCode = %q, want %q", got, want)
726 }
727 if stdout.Len() != 0 {
728 t.Fatalf("stdout = %q, want empty", stdout.String())
729 }
730}
731
732func TestGetStdoutFolderErrorHasInvalidArgumentsCode(t *testing.T) {
733 mock := &mockFilesClient{

Callers

nothing calls this directly

Calls 4

testGetJSONCmdFunction · 0.85
getFunction · 0.85
jsonErrorCodeFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected