S3 - Fix exception for missing versionID (#3887)

This commit is contained in:
amar jandu 2021-04-30 04:36:08 -07:00 committed by GitHub
commit 58381cce8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View file

@ -5013,10 +5013,10 @@ def test_get_unknown_version_should_throw_specific_error():
with pytest.raises(ClientError) as e:
client.get_object(Bucket=bucket_name, Key=object_key, VersionId="unknown")
e.value.response["Error"]["Code"].should.equal("InvalidArgument")
e.value.response["Error"]["Message"].should.equal("Invalid version id specified")
e.value.response["Error"]["ArgumentName"].should.equal("versionId")
e.value.response["Error"]["ArgumentValue"].should.equal("unknown")
e.value.response["Error"]["Code"].should.equal("NoSuchVersion")
e.value.response["Error"]["Message"].should.equal(
"The specified version does not exist."
)
@mock_s3