Skip to content

Commit

Permalink
Renamed s3managers upload integration test buffer instead of referenc…
Browse files Browse the repository at this point in the history
…ing upload_tests
  • Loading branch information
jasdel committed May 1, 2015
1 parent 3878080 commit 876a0d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions service/s3/s3manager/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (
"github.com/stretchr/testify/assert"
)

var md512MB = fmt.Sprintf("%x", md5.Sum(buf12MB))
var integBuf12MB = make([]byte, 1024*1024*12)
var integMD512MB = fmt.Sprintf("%x", md5.Sum(integBuf12MB))

var bucketName *string

Expand Down Expand Up @@ -79,14 +80,14 @@ func TestUploadConcurrently(t *testing.T) {
out, err := s3manager.Upload(svc, &s3manager.UploadInput{
Bucket: bucketName,
Key: &key,
Body: bytes.NewReader(buf12MB),
Body: bytes.NewReader(integBuf12MB),
}, nil)

assert.NoError(t, err)
assert.NotEqual(t, "", out.UploadID)
assert.Regexp(t, `^https?://.+/`+key+`$`, out.Location)

validate(t, key, md512MB)
validate(t, key, integMD512MB)
}

func TestUploadFailCleanup(t *testing.T) {
Expand All @@ -107,7 +108,7 @@ func TestUploadFailCleanup(t *testing.T) {
u, err := s3manager.Upload(svc, &s3manager.UploadInput{
Bucket: bucketName,
Key: &key,
Body: bytes.NewReader(buf12MB),
Body: bytes.NewReader(integBuf12MB),
}, &s3manager.UploadOptions{
LeavePartsOnError: false,
})
Expand Down

0 comments on commit 876a0d5

Please sign in to comment.