forked from jpillora/go-dropbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sharing_test.go
37 lines (29 loc) · 862 Bytes
/
sharing_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package dropbox
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSharing_CreateSharedLink(t *testing.T) {
c := client()
out, err := c.Sharing.CreateSharedLink(&CreateSharedLinkInput{
Path: "/hello.txt",
ShortURL: true,
})
assert.NoError(t, err, "error sharing file")
assert.Equal(t, "/hello.txt", out.Path)
}
func TestSharing_ListSharedFolder(t *testing.T) {
c := client()
out, err := c.Sharing.ListSharedFolders(&ListSharedFolderInput{
Limit: 1,
})
assert.NoError(t, err, "listing shared folders")
assert.NotEmpty(t, out.Entries, "output should be non-empty")
for out.Cursor != "" {
out, err = c.Sharing.ListSharedFoldersContinue(&ListSharedFolderContinueInput{
Cursor: out.Cursor,
})
assert.NoError(t, err, "listing shared folders")
assert.NotEmpty(t, out.Entries, "output should be non-empty")
}
}