(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestPutStdin_RejectsExistingFolder(t *testing.T) { |
| 67 | cmd := testPutCmdWithStdin(strings.NewReader("data")) |
| 68 | |
| 69 | mock := &mockFilesClient{ |
| 70 | getMetadataFn: func(arg *files.GetMetadataArg) (files.IsMetadata, error) { |
| 71 | return &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: arg.Path}}, nil |
| 72 | }, |
| 73 | } |
| 74 | stubFilesClient(t, mock) |
| 75 | |
| 76 | err := put(cmd, []string{"-", "/existing-folder"}) |
| 77 | if err == nil { |
| 78 | t.Fatal("expected error for existing folder target") |
| 79 | } |
| 80 | if !strings.Contains(err.Error(), "folder") { |
| 81 | t.Errorf("error = %q, want mention of folder", err.Error()) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | func TestPutStdin_UploadsContent(t *testing.T) { |
| 86 | content := "hello from stdin" |
nothing calls this directly
no test coverage detected