feat(files/sharing): refactor sharing apis with tests
This commit is contained in:
parent
5ef94afd7a
commit
80d54f42a1
5 changed files with 67 additions and 16 deletions
|
@ -387,6 +387,22 @@ func TestFileHandlers(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
for dirPath := range sharedPaths {
|
||||
res, _, errs := cl.IsSharing(dirPath)
|
||||
if len(errs) > 0 {
|
||||
t.Fatal(errs)
|
||||
} else if res.StatusCode != 200 {
|
||||
t.Fatal(res.StatusCode)
|
||||
}
|
||||
|
||||
res, _, errs = cl.IsSharing(fmt.Sprintf("%s/", dirPath))
|
||||
if len(errs) > 0 {
|
||||
t.Fatal(errs)
|
||||
} else if res.StatusCode != 404 {
|
||||
t.Fatal(res.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
for _, dirPath := range shRes.SharingDirs {
|
||||
res, lsResp, errs := cl.List(dirPath)
|
||||
if len(errs) > 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue