Merged in feature/ecr (pull request #161)
Feature/ecr * nosave * repo * awscli * unzip * ignore * moreram * 14k * ref * deployment * 12k * uselocal * go * dockercomd * reorder * iamgename * installs * tart * cli * clideps * y * dockerce * nodock * multi * rmecr * dev
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package documentclean
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -23,7 +22,7 @@ import (
|
||||
)
|
||||
|
||||
func TestClean(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
pool, err := pgxmock.NewPool()
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -113,7 +112,7 @@ func TestClean(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestExecuteCleanTasks(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
@@ -172,7 +171,7 @@ func TestExecuteCleanTasks(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStoreClean(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
pool, err := pgxmock.NewPool()
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package documentclean
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
@@ -21,7 +20,7 @@ import (
|
||||
|
||||
func TestGetBodyMimeType(t *testing.T) {
|
||||
t.Run("invalid type", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -59,7 +58,7 @@ func TestGetBodyMimeType(t *testing.T) {
|
||||
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
|
||||
})
|
||||
t.Run("pdf", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -108,7 +107,7 @@ func TestGetBodyMimeType(t *testing.T) {
|
||||
assert.Equal(t, documenttypes.MimeTypePDF, contentType)
|
||||
})
|
||||
t.Run("pdf start", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -157,7 +156,7 @@ func TestGetBodyMimeType(t *testing.T) {
|
||||
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
|
||||
})
|
||||
t.Run("pdf end", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -206,7 +205,7 @@ func TestGetBodyMimeType(t *testing.T) {
|
||||
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
|
||||
})
|
||||
t.Run("short", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -269,7 +268,7 @@ func TestGetMetadataMimeType(t *testing.T) {
|
||||
|
||||
func TestGetAcceptedMimeType(t *testing.T) {
|
||||
t.Run("invalid type", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -307,7 +306,7 @@ func TestGetAcceptedMimeType(t *testing.T) {
|
||||
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
|
||||
})
|
||||
t.Run("pdf mimetype", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -320,7 +319,7 @@ func TestGetAcceptedMimeType(t *testing.T) {
|
||||
assert.Equal(t, documenttypes.MimeTypePDF, contentType)
|
||||
})
|
||||
t.Run("pdf format", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -372,7 +371,7 @@ func TestGetAcceptedMimeType(t *testing.T) {
|
||||
|
||||
func TestGetBytesBuffer(t *testing.T) {
|
||||
t.Run("valid", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -412,7 +411,7 @@ func TestGetBytesBuffer(t *testing.T) {
|
||||
assert.NotNil(t, buffer)
|
||||
})
|
||||
t.Run("negative start", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
@@ -452,7 +451,7 @@ func TestGetBytesBuffer(t *testing.T) {
|
||||
assert.NotNil(t, buffer)
|
||||
})
|
||||
t.Run("zero length", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
cfg := &DocCleanConfig{}
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
cfg.StoreClient = mockS3
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package documentclean
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
@@ -33,7 +32,7 @@ type DocCleanConfig struct {
|
||||
}
|
||||
|
||||
func TestCreate(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
pool, err := pgxmock.NewPool()
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -139,7 +138,7 @@ func TestCreate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestInformClean(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
mockSQS := queuemock.NewMockSQSClient(t)
|
||||
|
||||
cfg := &DocCleanConfig{}
|
||||
|
||||
Reference in New Issue
Block a user