test(auth): add permission tests for files and settings api

This commit is contained in:
hexxa 2022-02-23 11:40:51 +08:00 committed by Hexxa
parent cff87bdddd
commit d2d269171d
5 changed files with 404 additions and 317 deletions

View file

@ -212,3 +212,11 @@ func assertDownloadOK(t *testing.T, filePath, content, addr string, token *http.
return true
}
func assertResp(t *testing.T, resp *http.Response, errs []error, expectedCode int, desc string) {
if len(errs) > 0 {
t.Fatal(errs)
} else if resp.StatusCode != expectedCode {
t.Fatal(desc, resp.StatusCode, expectedCode)
}
}