s3store: Fix tests by adding ContentLength property

This commit is contained in:
Marius 2022-07-11 15:01:24 +02:00
parent efe8c9ce05
commit f680b9f1ff
1 changed files with 42 additions and 35 deletions

View File

@ -755,6 +755,7 @@ func TestWriteChunk(t *testing.T) {
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(3),
Body: bytes.NewReader([]byte("1234")),
ContentLength: aws.Int64(4),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-3"),
}, nil)
@ -764,6 +765,7 @@ func TestWriteChunk(t *testing.T) {
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(4),
Body: bytes.NewReader([]byte("5678")),
ContentLength: aws.Int64(4),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-4"),
}, nil)
@ -773,6 +775,7 @@ func TestWriteChunk(t *testing.T) {
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(5),
Body: bytes.NewReader([]byte("90AB")),
ContentLength: aws.Int64(4),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-5"),
}, nil)
@ -893,6 +896,7 @@ func TestWriteChunkPrependsIncompletePart(t *testing.T) {
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(1),
Body: bytes.NewReader([]byte("1234")),
ContentLength: aws.Int64(4),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-1"),
}, nil)
@ -902,6 +906,7 @@ func TestWriteChunkPrependsIncompletePart(t *testing.T) {
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(2),
Body: bytes.NewReader([]byte("5")),
ContentLength: aws.Int64(1),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-2"),
}, nil)
@ -963,6 +968,7 @@ func TestWriteChunkPrependsIncompletePartAndWritesANewIncompletePart(t *testing.
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(1),
Body: bytes.NewReader([]byte("1234")),
ContentLength: aws.Int64(4),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-1"),
}, nil)
@ -1024,6 +1030,7 @@ func TestWriteChunkAllowTooSmallLast(t *testing.T) {
UploadId: aws.String("multipartId"),
PartNumber: aws.Int64(3),
Body: bytes.NewReader([]byte("1234567890")),
ContentLength: aws.Int64(10),
})).Return(&s3.UploadPartOutput{
ETag: aws.String("etag-3"),
}, nil)