forked from TrueCloudLab/s3-tests
Merge pull request #156 from gaul/read-unreadable-object
Test reading an unreadable object
This commit is contained in:
commit
dd44c92340
1 changed files with 12 additions and 0 deletions
|
@ -12291,3 +12291,15 @@ def test_copy_object_ifnonematch_failed():
|
|||
client.copy_object(Bucket=bucket_name, CopySource=bucket_name+'/foo', CopySourceIfNoneMatch='ABCORZ', Key='bar')
|
||||
resp = client.get_object(Bucket=bucket_name, Key='bar')
|
||||
eq(resp['Body'].read(), 'bar')
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='get')
|
||||
@attr(operation='read to invalid key')
|
||||
@attr(assertion='fails 400')
|
||||
def test_object_read_unreadable():
|
||||
bucket_name = get_new_bucket()
|
||||
client = get_client()
|
||||
e = assert_raises(ClientError, client.get_object, Bucket=bucket_name, Key='\xae\x8a-')
|
||||
status, error_code = _get_status_and_error_code(e.response)
|
||||
eq(status, 400)
|
||||
eq(e.response['Error']['Message'], 'Couldn\'t parse the specified URI.')
|
||||
|
|
Loading…
Reference in a new issue