]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Test reading an unreadable object 156/head
authorAndrew Gaul <andrew@gaul.org>
Tue, 14 Mar 2017 22:56:13 +0000 (15:56 -0700)
committerAndrew Gaul <andrew@gaul.org>
Sun, 24 Nov 2019 12:48:36 +0000 (21:48 +0900)
Signed-off-by: Andrew Gaul <andrew@gaul.org>
s3tests_boto3/functional/test_s3.py

index 1246394064eefb748c9f1dbe578d4e22f2f29524..c27a789d0a82f4f12a22caec1e1442fa9315ed78 100644 (file)
@@ -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.')