s3store: Fix tests by adding ContentLength property
This commit is contained in:
parent
efe8c9ce05
commit
f680b9f1ff
|
@ -755,6 +755,7 @@ func TestWriteChunk(t *testing.T) {
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(3),
|
PartNumber: aws.Int64(3),
|
||||||
Body: bytes.NewReader([]byte("1234")),
|
Body: bytes.NewReader([]byte("1234")),
|
||||||
|
ContentLength: aws.Int64(4),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-3"),
|
ETag: aws.String("etag-3"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -764,6 +765,7 @@ func TestWriteChunk(t *testing.T) {
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(4),
|
PartNumber: aws.Int64(4),
|
||||||
Body: bytes.NewReader([]byte("5678")),
|
Body: bytes.NewReader([]byte("5678")),
|
||||||
|
ContentLength: aws.Int64(4),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-4"),
|
ETag: aws.String("etag-4"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -773,6 +775,7 @@ func TestWriteChunk(t *testing.T) {
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(5),
|
PartNumber: aws.Int64(5),
|
||||||
Body: bytes.NewReader([]byte("90AB")),
|
Body: bytes.NewReader([]byte("90AB")),
|
||||||
|
ContentLength: aws.Int64(4),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-5"),
|
ETag: aws.String("etag-5"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -893,6 +896,7 @@ func TestWriteChunkPrependsIncompletePart(t *testing.T) {
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(1),
|
PartNumber: aws.Int64(1),
|
||||||
Body: bytes.NewReader([]byte("1234")),
|
Body: bytes.NewReader([]byte("1234")),
|
||||||
|
ContentLength: aws.Int64(4),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-1"),
|
ETag: aws.String("etag-1"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -902,6 +906,7 @@ func TestWriteChunkPrependsIncompletePart(t *testing.T) {
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(2),
|
PartNumber: aws.Int64(2),
|
||||||
Body: bytes.NewReader([]byte("5")),
|
Body: bytes.NewReader([]byte("5")),
|
||||||
|
ContentLength: aws.Int64(1),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-2"),
|
ETag: aws.String("etag-2"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -963,6 +968,7 @@ func TestWriteChunkPrependsIncompletePartAndWritesANewIncompletePart(t *testing.
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(1),
|
PartNumber: aws.Int64(1),
|
||||||
Body: bytes.NewReader([]byte("1234")),
|
Body: bytes.NewReader([]byte("1234")),
|
||||||
|
ContentLength: aws.Int64(4),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-1"),
|
ETag: aws.String("etag-1"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -1024,6 +1030,7 @@ func TestWriteChunkAllowTooSmallLast(t *testing.T) {
|
||||||
UploadId: aws.String("multipartId"),
|
UploadId: aws.String("multipartId"),
|
||||||
PartNumber: aws.Int64(3),
|
PartNumber: aws.Int64(3),
|
||||||
Body: bytes.NewReader([]byte("1234567890")),
|
Body: bytes.NewReader([]byte("1234567890")),
|
||||||
|
ContentLength: aws.Int64(10),
|
||||||
})).Return(&s3.UploadPartOutput{
|
})).Return(&s3.UploadPartOutput{
|
||||||
ETag: aws.String("etag-3"),
|
ETag: aws.String("etag-3"),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
|
Loading…
Reference in New Issue