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

Function TestGetFolderWithoutRecursiveFlag

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

Source from the content-addressed store, hash-verified

495}
496
497func TestGetFolderWithoutRecursiveFlag(t *testing.T) {
498 mock := &mockFilesClient{
499 getMetadataFn: func(arg *files.GetMetadataArg) (files.IsMetadata, error) {
500 return &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: arg.Path}}, nil
501 },
502 }
503 stubFilesClient(t, mock)
504
505 err := get(getCmd, []string{"/remote-folder"})
506 if err == nil {
507 t.Fatal("expected error for folder without --recursive")
508 }
509 if !strings.Contains(err.Error(), "--recursive") {
510 t.Errorf("error = %q, want mention of --recursive", err.Error())
511 }
512 if got, want := jsonErrorCode(err), jsonErrorCodeInvalidArguments; got != want {
513 t.Fatalf("jsonErrorCode = %q, want %q", got, want)
514 }
515}
516
517func TestGetRecursiveCommandGetsMetadataThenListsFolder(t *testing.T) {
518 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

stubFilesClientFunction · 0.85
getFunction · 0.85
jsonErrorCodeFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected