From 0c6ab519c68e2b5b8f4293fe24c87a35c693ed57 Mon Sep 17 00:00:00 2001 From: Lena Fuhrimann <6780471+cloudlena@users.noreply.github.com> Date: Tue, 18 Apr 2017 15:43:13 +0200 Subject: [PATCH] Fix typo --- bucket-view_test.go | 54 ++++++++++++++++++++++----------------------- get-object_test.go | 20 ++++++++--------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bucket-view_test.go b/bucket-view_test.go index 93d6f66..e3e00f7 100644 --- a/bucket-view_test.go +++ b/bucket-view_test.go @@ -17,10 +17,10 @@ func TestBucketViewHandler(t *testing.T) { assert := assert.New(t) tests := map[string]struct { - s3 S3Client - bucketName string - expectedStatusCode int - expectedBodyCountains string + s3 S3Client + bucketName string + expectedStatusCode int + expectedBodyContains string }{ "success (empty bucket)": { s3: &S3ClientMock{ @@ -28,9 +28,9 @@ func TestBucketViewHandler(t *testing.T) { {Name: "testBucket"}, }, }, - bucketName: "testBucket", - expectedStatusCode: http.StatusOK, - expectedBodyCountains: "No objects in", + bucketName: "testBucket", + expectedStatusCode: http.StatusOK, + expectedBodyContains: "No objects in", }, "success (with file)": { s3: &S3ClientMock{ @@ -41,9 +41,9 @@ func TestBucketViewHandler(t *testing.T) { {Key: "testFile"}, }, }, - bucketName: "testBucket", - expectedStatusCode: http.StatusOK, - expectedBodyCountains: "testBucket", + bucketName: "testBucket", + expectedStatusCode: http.StatusOK, + expectedBodyContains: "testBucket", }, "success (archive)": { s3: &S3ClientMock{ @@ -54,9 +54,9 @@ func TestBucketViewHandler(t *testing.T) { {Key: "archive.tar.gz"}, }, }, - bucketName: "testBucket", - expectedStatusCode: http.StatusOK, - expectedBodyCountains: "archive", + bucketName: "testBucket", + expectedStatusCode: http.StatusOK, + expectedBodyContains: "archive", }, "success (image)": { s3: &S3ClientMock{ @@ -67,9 +67,9 @@ func TestBucketViewHandler(t *testing.T) { {Key: "testImage.png"}, }, }, - bucketName: "testBucket", - expectedStatusCode: http.StatusOK, - expectedBodyCountains: "photo", + bucketName: "testBucket", + expectedStatusCode: http.StatusOK, + expectedBodyContains: "photo", }, "success (sound)": { s3: &S3ClientMock{ @@ -80,23 +80,23 @@ func TestBucketViewHandler(t *testing.T) { {Key: "testSound.mp3"}, }, }, - bucketName: "testBucket", - expectedStatusCode: http.StatusOK, - expectedBodyCountains: "music_note", + bucketName: "testBucket", + expectedStatusCode: http.StatusOK, + expectedBodyContains: "music_note", }, "bucket doesn't exist": { - s3: &S3ClientMock{}, - bucketName: "testBucket", - expectedStatusCode: http.StatusNotFound, - expectedBodyCountains: http.StatusText(http.StatusNotFound), + s3: &S3ClientMock{}, + bucketName: "testBucket", + expectedStatusCode: http.StatusNotFound, + expectedBodyContains: http.StatusText(http.StatusNotFound), }, "s3 error": { s3: &S3ClientMock{ Err: errors.New("mocked S3 error"), }, - bucketName: "testBucket", - expectedStatusCode: http.StatusInternalServerError, - expectedBodyCountains: http.StatusText(http.StatusInternalServerError), + bucketName: "testBucket", + expectedStatusCode: http.StatusInternalServerError, + expectedBodyContains: http.StatusText(http.StatusInternalServerError), }, } @@ -119,6 +119,6 @@ func TestBucketViewHandler(t *testing.T) { assert.NoError(err, tcID) assert.Equal(tc.expectedStatusCode, resp.StatusCode, tcID) - assert.Contains(string(body), tc.expectedBodyCountains, tcID) + assert.Contains(string(body), tc.expectedBodyContains, tcID) } } diff --git a/get-object_test.go b/get-object_test.go index 5491f74..1ed9ffe 100644 --- a/get-object_test.go +++ b/get-object_test.go @@ -16,20 +16,20 @@ func TestGetObjectHandler(t *testing.T) { assert := assert.New(t) tests := map[string]struct { - s3 S3Client - bucketName string - objectName string - expectedStatusCode int - expectedBodyCountains string + s3 S3Client + bucketName string + objectName string + expectedStatusCode int + expectedBodyContains string }{ "s3 error": { s3: &S3ClientMock{ Err: errors.New("mocked S3 error"), }, - bucketName: "testBucket", - objectName: "testObject", - expectedStatusCode: http.StatusInternalServerError, - expectedBodyCountains: http.StatusText(http.StatusInternalServerError), + bucketName: "testBucket", + objectName: "testObject", + expectedStatusCode: http.StatusInternalServerError, + expectedBodyContains: http.StatusText(http.StatusInternalServerError), }, } @@ -52,6 +52,6 @@ func TestGetObjectHandler(t *testing.T) { assert.NoError(err, tcID) assert.Equal(tc.expectedStatusCode, resp.StatusCode, tcID) - assert.Contains(string(body), tc.expectedBodyCountains, tcID) + assert.Contains(string(body), tc.expectedBodyContains, tcID) } }