added sse support for s3 (#3592)
* added sse support for s3 * lint fixed for py37
This commit is contained in:
parent
9784e1b487
commit
02ac5ca111
3 changed files with 71 additions and 2 deletions
|
|
@ -4973,3 +4973,29 @@ def test_request_partial_content_without_specifying_range_should_return_full_obj
|
|||
file = s3.Object(bucket, object_key)
|
||||
response = file.get(Range="")
|
||||
response["ContentLength"].should.equal(30)
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_object_headers():
|
||||
bucket = "my-bucket"
|
||||
s3 = boto3.client("s3")
|
||||
s3.create_bucket(Bucket=bucket)
|
||||
|
||||
res = s3.put_object(
|
||||
Bucket=bucket,
|
||||
Body=b"test",
|
||||
Key="file.txt",
|
||||
ServerSideEncryption="aws:kms",
|
||||
SSEKMSKeyId="test",
|
||||
BucketKeyEnabled=True,
|
||||
)
|
||||
res.should.have.key("ETag")
|
||||
res.should.have.key("ServerSideEncryption")
|
||||
res.should.have.key("SSEKMSKeyId")
|
||||
res.should.have.key("BucketKeyEnabled")
|
||||
|
||||
res = s3.get_object(Bucket=bucket, Key="file.txt")
|
||||
res.should.have.key("ETag")
|
||||
res.should.have.key("ServerSideEncryption")
|
||||
res.should.have.key("SSEKMSKeyId")
|
||||
res.should.have.key("BucketKeyEnabled")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue