mirror of
https://codeberg.org/scip/ephemerup.git
synced 2025-12-18 21:11:04 +01:00
+api doc, fixed endpoints
This commit is contained in:
@@ -111,7 +111,7 @@ func TestUploadFiles(t *testing.T) {
|
||||
name: "upload-file",
|
||||
apikey: "token",
|
||||
wantfail: false,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendjson: `{"success": true}`,
|
||||
files: []string{"../t/t1"}, // pwd is lib/ !
|
||||
@@ -121,7 +121,7 @@ func TestUploadFiles(t *testing.T) {
|
||||
name: "upload-dir",
|
||||
apikey: "token",
|
||||
wantfail: false,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendjson: `{"success": true}`,
|
||||
files: []string{"../t"}, // pwd is lib/ !
|
||||
@@ -131,7 +131,7 @@ func TestUploadFiles(t *testing.T) {
|
||||
name: "upload-catch-nonexistent-file",
|
||||
apikey: "token",
|
||||
wantfail: true,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendjson: `{"success": false}`,
|
||||
files: []string{"../t/none"},
|
||||
@@ -141,7 +141,7 @@ func TestUploadFiles(t *testing.T) {
|
||||
name: "upload-catch-no-access",
|
||||
apikey: "token",
|
||||
wantfail: true,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 403,
|
||||
sendjson: `{"success": false}`,
|
||||
files: []string{"../t/t1"},
|
||||
@@ -151,7 +151,7 @@ func TestUploadFiles(t *testing.T) {
|
||||
name: "upload-check-output",
|
||||
apikey: "token",
|
||||
wantfail: false,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendjson: `{"uploads":[
|
||||
{
|
||||
@@ -313,7 +313,7 @@ func TestDelete(t *testing.T) {
|
||||
name: "delete",
|
||||
apikey: "token",
|
||||
wantfail: false,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendjson: `{"success":true,"message":"","code":200}`,
|
||||
files: []string{"cc2c965a"},
|
||||
@@ -324,7 +324,7 @@ func TestDelete(t *testing.T) {
|
||||
name: "delete-catch-empty-json",
|
||||
apikey: "token",
|
||||
wantfail: true,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendjson: "",
|
||||
files: []string{"cc2c965a"},
|
||||
@@ -334,7 +334,7 @@ func TestDelete(t *testing.T) {
|
||||
name: "delete-catch-no-access",
|
||||
apikey: "token",
|
||||
wantfail: true,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 503,
|
||||
sendjson: listingnoaccess,
|
||||
files: []string{"cc2c965a"},
|
||||
@@ -365,7 +365,7 @@ func TestDownload(t *testing.T) {
|
||||
name: "download",
|
||||
apikey: "token",
|
||||
wantfail: false,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
sendfile: "../t/t1",
|
||||
files: []string{"cc2c965a"},
|
||||
@@ -376,7 +376,7 @@ func TestDownload(t *testing.T) {
|
||||
name: "download-catch-empty-response",
|
||||
apikey: "token",
|
||||
wantfail: true,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 200,
|
||||
files: []string{"cc2c965a"},
|
||||
method: "GET",
|
||||
@@ -385,7 +385,7 @@ func TestDownload(t *testing.T) {
|
||||
name: "download-catch-no-access",
|
||||
apikey: "token",
|
||||
wantfail: true,
|
||||
route: "/file/",
|
||||
route: "/uploads/",
|
||||
sendcode: 503,
|
||||
sendjson: listingnoaccess,
|
||||
files: []string{"cc2c965a"},
|
||||
|
||||
Reference in New Issue
Block a user