From 687a73e367ce4b0b9b5ae809fef92f6826e6860e Mon Sep 17 00:00:00 2001 From: jonaustin09 Date: Mon, 22 May 2023 23:45:17 +0400 Subject: [PATCH] fix: fixed responce test cases --- s3api/controllers/base_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/s3api/controllers/base_test.go b/s3api/controllers/base_test.go index a92f2216..0a260a7b 100644 --- a/s3api/controllers/base_test.go +++ b/s3api/controllers/base_test.go @@ -651,7 +651,6 @@ func Test_responce(t *testing.T) { err error } app := fiber.New() - ctx := app.AcquireCtx(&fasthttp.RequestCtx{}) tests := []struct { name string @@ -662,7 +661,7 @@ func Test_responce(t *testing.T) { { name: "Internal-server-error", args: args{ - ctx: ctx, + ctx: app.AcquireCtx(&fasthttp.RequestCtx{}), resp: nil, err: s3err.GetAPIError(16), }, @@ -672,7 +671,7 @@ func Test_responce(t *testing.T) { { name: "Error-not-implemented", args: args{ - ctx: ctx, + ctx: app.AcquireCtx(&fasthttp.RequestCtx{}), resp: nil, err: s3err.GetAPIError(50), }, @@ -682,20 +681,21 @@ func Test_responce(t *testing.T) { { name: "Invalid-request-body", args: args{ - ctx: ctx, + ctx: app.AcquireCtx(&fasthttp.RequestCtx{}), resp: make(chan int), err: nil, }, wantErr: true, - statusCode: 501, + statusCode: 200, }, { name: "Successful-response", args: args{ - ctx: ctx, + ctx: app.AcquireCtx(&fasthttp.RequestCtx{}), resp: "Valid response", err: nil, }, + wantErr: false, statusCode: 200, }, }